01-22-2013 09:47 AM - edited 03-04-2019 06:48 PM
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
01-22-2013 10:51 AM
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
01-22-2013 10:58 AM
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
01-23-2013 02:56 AM
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
01-23-2013 12:22 PM
/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
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