- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2020 12:45 PM
Hello guys,
I have the following VLANS and their corresponding SVIs on a switch. I need to deploy ACLs for SSH based on the following criteria
- Only 2 IPs can SSH the switch i.e. 192.168.1.1 & 192.168.1.2 (This I have no issue with)
- The switch can only be SSHed on 192.168.1.177 the management IP and no other IP. (What I need help with)
!
interface Vlan57
description ***BRANCH FIREWALL VLAN***
ip address 172.16.57.2 255.255.255.0
!
interface Vlan601
description *******BRANCH CAMERA VLAN**********
ip address 172.16.2.126 255.255.255.192
!
interface Vlan602
description *********BRANCH CLIENTS VLAN***********
ip address 172.16.3.126 255.255.255.224
!
interface Vlan603
description *******BRANCH SERVER AREA VLAN********
ip address 172.16.3.190 255.255.255.240
!
interface Vlan511
description ******BRANCH_INACTIVE_PORTS**************
no ip address
shutdown
!
interface Vlan233
description *******BRANCH MANAGEMENT VLAN*********
ip address 192.168.1.177 255.255.255.248
!
Kindly assist, please.
Regards,
Shaqxify
Solved! Go to Solution.
- Labels:
-
LAN Switching
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2020 01:01 PM
option1
access-list 10 permit host 192.168.1.1
access-list 10 permit host 192.168.1.2
line vty 0 4
access-class 10 in
transport input ssh
option2
ip access-list extended 100
permit tcp host 192.168.1.1 host 192.168.1.177 eq ssh
permit tcp host 192.168.1.2 host 192.168.1.177 eq ssh
line vty 0 4
access-class 100 in
transport input ssh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2020 01:01 PM
option1
access-list 10 permit host 192.168.1.1
access-list 10 permit host 192.168.1.2
line vty 0 4
access-class 10 in
transport input ssh
option2
ip access-list extended 100
permit tcp host 192.168.1.1 host 192.168.1.177 eq ssh
permit tcp host 192.168.1.2 host 192.168.1.177 eq ssh
line vty 0 4
access-class 100 in
transport input ssh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2020 07:12 AM - edited 12-07-2020 07:15 AM
Thank You So Much @balaji.bandi I Do Deeply Appreciate Your Consistency In Selflessly Helping. I Am Currently Overseeing Training This Week (I Juggle Two Hats Project Management & Network Lead) But Next Week I Will Do The Configurations On The Switches. I Am Sure It Will Work.
I Will Share The Feedback.
Cheers
Shaqx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2020 12:14 PM
Sure some time need to play different Roles to meet the requirement of the business that is understandble.
please let us know how it goes.. thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2020 01:12 PM
Try this:
ip access-list standard test remark test permit host 192.168.1.1 host 192.168.1.77 permit host 192.168.1.2 host 192.168.1.77
line vty 0 4 access-class test in
HTH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2020 10:49 AM
Shaqxify
The suggestion from @balaji.bandi for option 2 looks logical but unfortunately it will not work as you want. When using access-class the normal practice is to use standard access list, which identifies the originating device IP address. When you use an extended access list for access-class inbound it ignores the destination address that you have specified (treats is as any). So you would not be able to limit access attempts to only the one interface address using access-class with extended access list..
The first part of your requirement is easy - you can limit access to the 2 source addresses using access-class on the vty which would use a standard access list, as was suggested in previous responses. The second part where you want to control which address is used for access is not easy. We do not know what model of switch or what version of code you are running so we are not sure which alternatives you could use.
1) Perhaps something like Control Plane Policing could be used to control remote access in a way that achieves both of your requirements.
2) Use an extended access list specifying both the source address and destination address for SSH. The logic might be something like this:
- You would need entries to permit each of the source addresses to the single destination address that you want.
- You would then need entries to deny any source to each of the L3 interface addresses on the switch for SSH.
- These parts of the access list would need to be applied to every L3 interface on the switch. If a L3 interface already has an inbound access list applied then this logic needs to be added to the existing acl and preferably would be the very first statements in the acl (you want to be sure that existing acl entries would not permit the access that you are trying to deny).
If a L3 interface does not already have an inbound access list applied then you need to create an access list with this logic and then a permit any for all other traffic.
Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2020 07:19 AM - edited 12-07-2020 07:34 AM
Hi Richard,
I am working with Cisco 2960x Switch Running on c2960x-universalk9-mz.152-7.E3.bin IOS image. Any further contribution from you will be highly appreciated.
How about creating more ACLs in option 2 barring SSH to the other SVIs? Just a thought.
option2
ip access-list extended 100
permit tcp host 192.168.1.1 host 192.168.1.177 eq ssh
permit tcp host 192.168.1.2 host 192.168.1.177 eq ssh
deny tcp host 192.168.1.1 host 172.16.3.126 eq ssh
deny tcp host 192.168.1.1 host 172.16.2.126 eq ssh
deny tcp host 192.168.1.1 host 172.16.3.190 eq ssh
line vty 0 4
access-class 100 in
transport input ssh
@balaji.bandi @Reza Sharifi You all are welcome to weigh in on this.
Much respect to you guys,
Shaqx
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2020 02:02 PM
Shaqx
Apparently you did not understand my previous explanation. So let me try again. When you apply an access list using access-class (rather than access-group) the behavior is different from what you expect. The processing of the access list will not match on destination addresses but only matches on source addresses. So your attempt to use extended access list in access-class will not achieve what you want.
Rick
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2020 07:28 AM
Thanks @Reza Sharifi I Deeply Appreciatte You Valuable Contribution I Will Let You Know How It Goes.
Respect & Regards,
Shaqx
