Monday, September 27, 2010

Understanding Wild Card Mask - With EIGRP

It's been a long time now since Cisco Introduced WildCard Mask support for EIGRP.  In my opinion it's a great option as it gives us control on which router interfaces we exactly want to run EIGRP and form neighbor-ship.

Although Idea looks simple but I have seen it still creates confusion for many people when it comes to calculate wildcard mask to enable eigrp on multiple interfaces in a single run and still not running it over undesired interfaces.


Although network followed by wild card mask as 0.0.0.0 is the most common way to make sure you don't run EIGRP on undesired interfaces. On the other hand some may prefer our old friend passive-interface command.


But lets see if we can enable EIGRP for multiple interfaces with a single network statement without including undesired interfaces.


Here is the topology diagram - Click Image to enlarge






The idea here is to enable EIGRP for all loopbacks over R1 & R2 with a single network statement.


Lets first load the initials:


Device R3 in the middle is a Router acting as bridge. Don't worry if you don't understand bridging at this moment as I am soon gonna come up with detailed posts on various bridging types :-)


Just Consider R3 as a L2 Switch at this moment connecting R1 and R2


:::Initials:::



Router#sh ver | i IOS
Cisco IOS Software, 3700 Software (C3725-ADVENTERPRISEK9-M), Version 12.4(15)T7, RELEASE SOFTWARE (fc3)

<<< R1 >>>


en
!
conf t
!
ho R1
!
no ip domain-lo
!
int lo0
ip add 1.1.1.0 255.255.255.255
exit
!
int lo1
ip add 1.1.1.1 255.255.255.255
exit
!
int lo2
ip add 1.1.1.2 255.255.255.255
exit
!
int lo3
ip add 1.1.1.3 255.255.255.255
exit
!
int f0/0
ip add 12.12.12.1 255.255.255.0
no sh 
exit
!
-------------------------------


<<< R2 >>>


en
!
conf t
!
ho R2
!
no ip domain-lo
!
int f0/0
ip add 12.12.12.2 255.255.255.0
no sh 
exit
!
int lo0
ip add 2.2.2.24 255.255.255.255
exit
!12.12.12.1
int lo1
ip add 2.2.2.25 255.255.255.255
exit
!
int lo2
ip add 2.2.2.26 255.255.255.255
exit
!
int lo3
ip add 2.2.2.27 255.255.255.255
exit
!
int lo4
ip add 2.2.2.28 255.255.255.255
exit
!
int lo5
ip add 2.2.2.29 255.255.255.255
exit
!
int lo6
ip add 2.2.2.30 255.255.255.255
exit
!
int lo7
ip add 2.2.2.31 255.255.255.255
exit
!
-------------------------------


<<< R3 >>>


en
!
conf t
!
ho BRIDGE
!
no ip domain-lo
!
no ip routing
!
bridge 1 protocol ieee
!
int f0/0
bridge-group 1
no sh
exit
!
int f0/1
bridge-group 1
no sh
exit
!

Lets verify now if R1 and R2 have basic reachability to each other before enabling EIGRP:

-------------------------------

R1(config)#do ping 12.12.12.2

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.12.12.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/9/12 ms

R2(config)#do ping 12.12.12.1

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 12.12.12.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/11/12 ms
-----------------------------

Now before configuring EIGRP, let's calculate the wild card mask :-)

----------------------------
<<< R1 >>>


1.1.1.0
1.1.1.1
1.1.1.2
1.1.1.3
--------

As you can see first three octet of all Loopbacks are same, so lets focus on 4th one.

Lets break 4th octet down into binary first
      
1.1.1.|0| > 000000|00|
1.1.1.|1| > 000000|01|
1.1.1.|2| > 000000|10|
1.1.1.|3| > 000000|11|

Now as you can see all bits are common among these binary addresses except last two bits from LSB side.

The idea now is to set value as "1" for uncommon bits and "0" for common bits and convert it back into decimal

Because from CCNA you must remember 0 = Match, 1 = Not Match

----------------------
            000000|11| -> 3
----------------------

0.0.0.3 ->That's going to be the wild card mask

Now lets configure EIGRP with this:

!
router eigrp 100
net 1.1.1.0 0.0.0.3
net 12.12.12.1 0.0.0.0
no au
end
!
=====================

Apply same method for R2's loopbacks:

<<< R2 >>>

2.2.2.24
2.2.2.25
2.2.2.26
2.2.2.27
2.2.2.28
2.2.2.29
2.2.2.30
2.2.2.31
--------

24 > 00011|000
25 > 00011|001
26 > 00011|010
27 > 00011|011
28 > 00011|100
29 > 00011|101
30 > 00011|110
31 > 00011|111
--------------
     00000|111 -> 7
--------------

2.2.2.24 0.0.0.7

!
router eigrp 100
no au
net 12.12.12.2 0.0.0.0
net 2.2.2.24 0.0.0.7
end
!
===============



Verification:



<<< R1 >>>


*Mar  1 00:25:01.947: %DUAL-5-NBRCHANGE: IP-EIGRP(0) 100: Neighbor 12.12.12.2 (FastEthernet0/0) is up: new adjacency

R1#sh ip ro e
     2.0.0.0/32 is subnetted, 8 subnets
D       2.2.2.24 [90/409600] via 12.12.12.2, 00:00:28, FastEthernet0/0
D       2.2.2.25 [90/409600] via 12.12.12.2, 00:00:28, FastEthernet0/0
D       2.2.2.26 [90/409600] via 12.12.12.2, 00:00:28, FastEthernet0/0
D       2.2.2.27 [90/409600] via 12.12.12.2, 00:00:28, FastEthernet0/0
D       2.2.2.28 [90/409600] via 12.12.12.2, 00:00:28, FastEthernet0/0
D       2.2.2.29 [90/409600] via 12.12.12.2, 00:00:28, FastEthernet0/0
D       2.2.2.30 [90/409600] via 12.12.12.2, 00:00:28, FastEthernet0/0
D       2.2.2.31 [90/409600] via 12.12.12.2, 00:00:28, FastEthernet0/0




tclsh
foreach address {
2.2.2.24
2.2.2.25
2.2.2.26
2.2.2.27
2.2.2.28
2.2.2.29
2.2.2.30
2.2.2.31
} {ping $address}
===================================

<<< R2 >>>


R2#sh ip ro e
     1.0.0.0/32 is subnetted, 4 subnets
D       1.1.1.0 [90/409600] via 12.12.12.1, 00:00:18, FastEthernet0/0
D       1.1.1.1 [90/409600] via 12.12.12.1, 00:00:18, FastEthernet0/0
D       1.1.1.2 [90/409600] via 12.12.12.1, 00:00:18, FastEthernet0/0
D       1.1.1.3 [90/409600] via 12.12.12.1, 00:00:18, FastEthernet0/0


tclsh
foreach address {
1.1.1.0
1.1.1.1
1.1.1.2
1.1.1.3
} {ping $address}
===================================

HTH...
Deepak Arora

3 comments:

Sidney Dsouza said...

Thanks this was really helpful

rishu saini said...

Easy & Simple.....thnx

rishu saini said...

very simle & easy to understand....
Thnx