01-05-2011 06:02 AM - edited 03-06-2019 02:49 PM
I want to restrict access to a device on an ethernet port. I have the following very simple access list coded and applied on the port.
Extended IP access list 100
10 permit ip 10.51.2.0 0.0.0.255 any
interface GigabitEthernet0/47
description Link to Media recorders
ip access-group 100 in
no logging event link-status
no snmp trap link-status
spanning-tree portfast
FYI: the devices on this port are actually connected to hub which in turn is connected to port 47.
Only network 10.51.2.0 is to be permitted access to these devices. All others are to be denied.
However I find that this applied access list does nothing to restrict my local network 10.49 from accessing the devices on the port.
What am I doing wrong?
2nd question
If I wanted to allow just one IP from the 10.49 subnet access to this port what would I code?
Solved! Go to Solution.
01-05-2011 07:56 AM
ok first lets go through this,
The access-list is to be applied to a switch.
a switch can forward many different types of protocol, not only IP, the access-list will not stop that.
many people miss that small but quite important thing.
second the switch "normally" only accepts access-lists incoming towards the interface.
this means that if you add the access-list only on one interface it will only stop the traffic coming back, it will not stop fx udp to be sent TO the devices.
In your case you are permitting all traffic from the devices you are to "defend" wich means that the access list and the added second point above means that no traffic is restricted. ie all traffic allowed.
access-list 100 permit tcp 192.168.1.1 0 0.0.0.255 host 192.168.2.2 eq www
allows 192.168.1.1 network to enter the interface if the destination is 192.168.2.2 port 80
so how can we help you with this ?
well
we know that your devices are 10.51.2.220 - 223
And want to only allow the local site to access these video recorders but not the remote sites with one exception; your IP which is at 10.49.x.x.
so this is how I would do it.
access-list 100 permit ip host 10.51.2.220 10.51.2.0 0.0.0.255 log
access-list 100 permit ip host 10.51.2.221 10.51.2.0 0.0.0.255 log
access-list 100 permit ip host 10.51.2.222 10.51.2.0 0.0.0.255 log
access-list 100 permit ip host 10.51.2.223 10.51.2.0 0.0.0.255 log
access-list 100 permit ip host 10.51.2.220 host 10.49.x.x log
access-list 100 permit ip host 10.51.2.222 host 10.49.x.x log
access-list 100 permit ip host 10.51.2.223 host 10.49.x.x log
access-list 100 deny ip any any log
You can do it like this
access-list 100 permit ip 10.51.2.220 0.0.0.255 10.51.2.0 0.0.0.255 log
access-list 100 permit ip 10.51.2.220 0.0.0.255 host 10.49.x.x log
Message was edited by: hobbe
01-05-2011 06:41 AM
What is the address on the device on g0/47 ? I suspect you have it applied in the wrong direction .
01-05-2011 06:54 AM
Hi John,
Try configure like below and see.
ip access-list extended 100
permit ip 10.51.2.0 0.0.0.255 any
deny ip any any
interface Gi0/47
description Link to Media recorders
ip access-group 100 in
And as glent asked, please give us the device IP address which is connected in interface Gi0/47.
Please rate if this helps you.
Regards,
Naidu.
01-05-2011 07:00 AM
The devices which are connected on a hub are 10.51.2.220 - 223
I want to only allow the local site to access these video recorders but not the remote sites with one exception; my IP which is a 10.49.x.x.
01-05-2011 07:56 AM
ok first lets go through this,
The access-list is to be applied to a switch.
a switch can forward many different types of protocol, not only IP, the access-list will not stop that.
many people miss that small but quite important thing.
second the switch "normally" only accepts access-lists incoming towards the interface.
this means that if you add the access-list only on one interface it will only stop the traffic coming back, it will not stop fx udp to be sent TO the devices.
In your case you are permitting all traffic from the devices you are to "defend" wich means that the access list and the added second point above means that no traffic is restricted. ie all traffic allowed.
access-list 100 permit tcp 192.168.1.1 0 0.0.0.255 host 192.168.2.2 eq www
allows 192.168.1.1 network to enter the interface if the destination is 192.168.2.2 port 80
so how can we help you with this ?
well
we know that your devices are 10.51.2.220 - 223
And want to only allow the local site to access these video recorders but not the remote sites with one exception; your IP which is at 10.49.x.x.
so this is how I would do it.
access-list 100 permit ip host 10.51.2.220 10.51.2.0 0.0.0.255 log
access-list 100 permit ip host 10.51.2.221 10.51.2.0 0.0.0.255 log
access-list 100 permit ip host 10.51.2.222 10.51.2.0 0.0.0.255 log
access-list 100 permit ip host 10.51.2.223 10.51.2.0 0.0.0.255 log
access-list 100 permit ip host 10.51.2.220 host 10.49.x.x log
access-list 100 permit ip host 10.51.2.222 host 10.49.x.x log
access-list 100 permit ip host 10.51.2.223 host 10.49.x.x log
access-list 100 deny ip any any log
You can do it like this
access-list 100 permit ip 10.51.2.220 0.0.0.255 10.51.2.0 0.0.0.255 log
access-list 100 permit ip 10.51.2.220 0.0.0.255 host 10.49.x.x log
Message was edited by: hobbe
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide