cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3017
Views
5
Helpful
4
Replies

access-list to match odd and even networks

Hi All,

How  to create access-list to match odd and even no in below subnet as i need to route via two differnet links.

10.130.0.0/16

4 Replies 4

Richard Burts
Hall of Fame
Hall of Fame

It would help if we knew a bit more about your environment and what you are attempting to achieve. In particular we need to know the subnet mask of the networks that you want to match.

The most important part of solving this is to set the mask in the access list so that it matches the last bit of the subnet mask and does not care about the other bits of the subnet.

So for example, if you want to do subnets with /24 and want to match even subnets then this access list would work

access-list 1 permit 10.130.0.0 0.0.1.255

and this access list to match the odd subnets

access-list 2 permit 10.130.1.0 0.0.1.255

HTH

Rick

HTH

Rick

Hi,

For me i have to route my /16 out from my 2 NAT box.

So i pefer odd via one NAT box and even via other NAT box.

So will the below help me.

access-list 1 permit 10.130.0.0 0.0.1.255

and this access list to match the odd subnets

access-list 2 permit 10.130.1.0 0.0.1.255

mlund
Level 7
Level 7

Hi

Sorry Richard, I don't agree with You

If we assume the network is divided in /24 blocks.

The even networks will match against

10.130.0.0 0.0.254.255

wich means in third octet any bit can be whatever, except the last one, wich must be zero

and all odd will match against

10.130.1.0 0.0.254.255

in third octet the last bit must be one

/Mikael

/Mikael is exactly correct (and gets +5 from me). I made a mistake and he caught it and corrected it. I described it correctly that you want to check only the last bit in the subnet bits. But I created an example that inverted the mask in that octet. The mask should be 0.0.254.255 and not 0.0.1.255.

It is one of the excellent things about the forum that many participants are reading responses and making sure that the response is correct and makes sense, and offering corrections when a response is not correct.

HTH

Rick

HTH

Rick
Review Cisco Networking for a $25 gift card