Book now with code EOY2025
Forsaken_GA wrote: » not just because some programmer at Cisco was feeling whimsical one day hehe
Forsaken_GA wrote: » Actually, that's not true. It may work out to the being the same in your practice sessions, but in the real world, wildcard masks differ greatly from subnet masks. The wildcard mask gives you great flexibility. Let's say I have a /24, netmask is set to 255.255.255.0 Now, let's say I want to apply an ACL that applies to only the hosts .4 through .7 I can either configure 4 lines, one for each host, or I can use the wildcard mask 0.0.0.3 It's all just binary ANDing. If you compare the values in binary, 4 through 7 have the first six bits in common, 000001, so you need those bits to match exactly, the last 2 bits can vary. So instead of using 4 lines in ACL to match hosts in a subnet, I've used one. You could also do stuff like make ACL's apply to only odd hosts, or only even hosts, or only hosts which are a multiple of 8. To simply things, subnet masks are what you use to identify networks. Wildcard masks are what you use to identify the hosts within those networks.
mzinz wrote: » In your example, why couldn't I just use a subnet mask of 255.255.255.252?
Forsaken_GA wrote: » Well, for starters, that's the subnet mask for a /30, which only has 2 usable hosts. Remember, subnet masks identify networks, and each network *has* to have a network identifier and a broadcast address, with only a couple exceptions (ie, using /31's on point to point interfaces, and using /32's for host routes/loopbacks). Let me throw you another example that may help illustrate it a bit more - Assuming a /24 mask, I want a rule that will apply to all even numbered hosts on the network. So the wildcard mask in this case would be 0.0.0.254. The only bit I care about is the first bit, and I need it to match 0. The rest of the host bits could be whatever, the only way they could possibly be an odd number is if the first bit is on. So how would you represent that with a subnet mask? If you take the inverse mask like most of you are used to, it'd result in 255.255.255.1, which is not a valid subnet mask. When your ACL's are being applied to an entire network, then yes, the inverse mask works fine, because both are essentially identifying the same thing, just through different methods. But the second you start to need rules that apply to a subset of hosts within that network, the use of an inverse mask is probably not going to be applicable.
Assuming a /24 mask, I want a rule that will apply to all even numbered hosts on the network. So the wildcard mask in this case would be 0.0.0.254. The only bit I care about is the first bit, and I need it to match 0. The rest of the host bits could be whatever, the only way they could possibly be an odd number is if the first bit is on.
wbosher wrote: » OK, I get that but what would be the wildcard mask for odd numbered hosts and why? This is probably above CCNA level but it's interesting.
Forsaken_GA wrote: » It'd be the same, but you'd match it against an IP that had the 1st bit turned on. ie, if I apply the rule as 192.168.40.2 0.0.0.254, it matches all even numbered hosts, because that IP and that mask says that the first three octets have to match, and on the fourth octet, the first bit has to match (which in this case it would be off) and the other 7 bits can be whatever. if I apply it against 192.168.40.3 0.0.0.254, it applies to all odd numbered hosts. Same thing, first three octets have to match, and the first bit has to match, which since this is an odd number, means the first bit is turned on, and the other 7 bits can be whatever.
erfolg255 wrote: » Wboshrer your trick with wild card mask is great thx now will be for me much more easy
wbosher wrote: » It is a good trick and will probably save some time on the CCNA exam, but looking at the posts by Forsaken_GA, it loos as though it really pays to understand the binary side of it as well, especially for more advanced studies.
new2net wrote: » so in the first case we took 172.16.10.0 and applied 0.0.0.3 to it and in the second case we took 172.16.10.4 and applied 0.0.0.3 to it correct....?
Use code EOY2025 to receive $250 off your 2025 certification boot camp!