0

I noticed that in the CBT learning videos, a lot of teachers ignored using the wildcard mask when configuring the EIGRP, however, they always used it when they configured OSPF. I looked on the internet to know why that was, but I could not understand the explanations there. I only knew that it was almost a must to use it in the case of OSPF.

What is the difference?

Update:

More precisely:

*What would happen if we ignore configuring the wildcard make in both cases (iegrp, ospf)?

EIGRP Packet Trace Routing Lab Example.

Configuration Sample:

R02(config)#do sh ip protocol

Routing Protocol is "eigrp  22 " 
  Outgoing update filter list for all interfaces is not set 
  Incoming update filter list for all interfaces is not set 
  Default networks flagged in outgoing updates  
  Default networks accepted from incoming updates 
  Redistributing: eigrp 22
  EIGRP-IPv4 Protocol for AS(22)
    Metric weight K1=1, K2=0, K3=1, K4=0, K5=0
    NSF-aware route hold timer is 240
    Router-ID: 192.168.0.109
    Topology : 0 (base)
      Active Timer: 3 min
      Distance: internal 90 external 170
      Maximum path: 4
      Maximum hopcount 100
      Maximum metric variance 1

  Automatic Summarization: disabled
  Automatic address summarization: 
  Maximum path: 4
  Routing for Networks:  
     192.168.0.0
  Routing Information Sources:  
    Gateway         Distance      Last Update 
    192.168.0.110   90            1013492133 
    192.168.0.117   90            1013492136 
  Distance: internal 90 external 170

R02(config)#do sh ip rout
Codes: L - local, C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area
       * - candidate default, U - per-user static route, o - ODR
       P - periodic downloaded static route

Gateway of last resort is not set

     192.168.0.0/24 is variably subnetted, 12 subnets, 3 masks
D       192.168.0.16/28 [90/5376] via 192.168.0.110, 03:16:45, GigabitEthernet0/1
D       192.168.0.32/28 [90/5632] via 192.168.0.117, 03:16:45, GigabitEthernet0/2
D       192.168.0.48/28 [90/5888] via 192.168.0.110, 03:16:45, GigabitEthernet0/1
C       192.168.0.104/29 is directly connected, GigabitEthernet0/1
L       192.168.0.109/32 is directly connected, GigabitEthernet0/1
C       192.168.0.112/29 is directly connected, GigabitEthernet0/2
L       192.168.0.118/32 is directly connected, GigabitEthernet0/2
D       192.168.0.120/29 [90/3072] via 192.168.0.117, 03:16:45, GigabitEthernet0/2
D       192.168.0.128/29 [90/3072] via 192.168.0.110, 03:16:45, GigabitEthernet0/1
D       192.168.0.136/29 [90/3328] via 192.168.0.110, 03:16:45, GigabitEthernet0/1
D       192.168.0.144/29 [90/3584] via 192.168.0.117, 03:16:45, GigabitEthernet0/2
                         [90/3584] via 192.168.0.110, 03:16:45, GigabitEthernet0/1
D       192.168.0.152/29 [90/3328] via 192.168.0.117, 03:16:45, GigabitEthernet0/2

R02(config)#do sh run
Building configuration...

Current configuration : 777 bytes
!
version 15.1
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname R02
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
license udi pid CISCO2911/K9 sn FTX1524PI2Z-
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface GigabitEthernet0/0
 no ip address
 duplex auto
 speed auto
 shutdown
!
interface GigabitEthernet0/1
 ip address 192.168.0.109 255.255.255.248
 duplex auto
 speed auto
!
interface GigabitEthernet0/2
 ip address 192.168.0.118 255.255.255.248
 duplex auto
 speed auto
!
interface Vlan1
 no ip address
 shutdown
!
router eigrp 22
 network 192.168.0.0
!
ip classless
!
ip flow-export version 9
!
!
!
!
!
!
!
line con 0
 exec-timeout 0 0
!
line aux 0
!
line vty 0 4
 login
!
!
!
end

and Here is the Network Topology:

enter image description here

1 Answer 1

6

I'll assume you are referring to the wildcard mask being used with the network ... statements in EIGRP and OSPF configurations.

As in (pseudo config code)

router ospf 100
 router-id <some32bitIntegerInDottedDecimalNotation>
 network 192.168.0.1 0.0.0.0 area <AREA ID> 
 network 192.168.0.129 0.0.0.0 area <AREA ID>

interface gig0/1
 ip address 192.168.0.1 255.255.225.192
 [...]

interface gig0/2
 ip address 192.168.0.129 255.255.225.224
 [...]

For OSPF and EIGRP, there must be a definition which IP interfaces of the router should be active for the routing protocol.

Classically, this is done using the network statement with a wildcard mask: All IP interfaces on the router are checked against the network & wildcard mask statements.

If there is a match, the interface with that IP address will become an active interface for the routing protocol (cf show ip ospf|eigrp interface brief), and it will start "talking" OSPF (EIGRP, respectively). It will make itself known by sending out OSPF/EIGRP hello packets, will attempt to discover neighbors and establish adjacencies, and eventually exchange routing information with the the neighbors.

It is very important to understand that network statement & wildcard mask are independent from interface IP address & subnet mask:

Please note: Only the interface's IP address is checked against the wildcard mask; the interface's subnet mask is not checked.

It is perfectly correct, even desirable, to have...

192.168.0.1 255.255.255.192 on the interface and

192.168.0.1 0.0.0.0 in the routing protocol's network statement

The network & wildcard mask statement only and exlusively has the purpose of defining those interfaces/IP addresses which should speak EIGRP/OSPF to their neighbors on a link.

It has no function of a "route filter" to select which IP addresses of an attached subnet are being advertised by OSPF or EIGRP to the other routers.

Once an interface is defined as active interface, OSPF/EIRP will look at the subnet mask from the interface configuration, and will > determine from that what to tell it's neighbors, not from the wildcard mask.

In the example here, network 192.168.0.1 0.0.0.0 will make the router's interface with the IP 192.168.0.1 an active interface, but EIGRP/OSFP will tell the other routers that there is a network/subnet of 192.168.0.0 255.255.255.192 in the routing domain.

There can be multiple network... statements, of course, and by using the host mask 0.0.0.0, you can get detailed control over which interface(s) of a router are active speakers. Using large wildcard masks might activate the routing protocol on interfaces where it's not needed or undesirable, possibly causing various kinds of side effects.

The independence between IP address & subnet mask and network statement & wildard mask can also be illustraded by looking at the more modern config styles, where network statements don't exist anymore.

In a more modern style for OSPF, you can activate an interface for OSPF directly in interface configuration mode, like (again, pseudo config code):

router ospf 100
 router-id <some32bitIntegerInDottedDecimalNotation>

interface gig0/0
 ip address 192.168.0.1 255.255.255.192
 ip ospf 100 area <AREA ID>

(please note: Unfortunately, the same is not possible for EIGRP for IPv4).

In IPv6, for both OSPF and EIGRP, the interfaces to be active for the routing protocol are exclusively defined in the modern per-interface configuration style.

So you may want to check if the CBT examples you are referring to ...

  • have a single large subnet & wildcard-mask statement in the router's configuration, which just so happens to match all IP interfaces of the given router [1]
  • use the more modern per-interface configuration style

To provide a direct answer:

No difference. For both OSPF and EIGRP, the network ... statement defines which interfaces of the router should be considered relevant to the routing protocol.

If an interface's IP address matches the wildcard mask, the interface will start "talking the routing protocol" (unless configured to be a passive-interface, but that's another topic)

If ignoring/omitting the network statement

If you omit/ignore the network statement, and if you do not use any other means to define the interfaces to be active: The routing protocol will be configured and active, but the router will not attempt to discover neighbors and wil not try talking to them, and of course will not exchange routing information with them.

Omitting the wildcard mask in network statement

If you omit the wildcard mask, the network statement is interpreted as if having the classful mask pertaining to the IP address.

192.168.0.0 is read as 192.168.0.0 0.0.0.255
172.19.0.0  is read as 172.19.0.0 0.0.255.255
etc. 

So here we stumble over a configuration fossil from the ages of classful networking. "Network Classes are long dead, obsoleted in 1993" as @Zac67 often puts it. Still, every so often, we find bits of it.


[1] basic config examples found on the web often match the wildcard masks in network statements with the interface subnet masks, or they bluntly use large wildcard masks. While not actually wrong, I think this is suboptimal practice especially for novices, because it somewhat obfuscates what is actually happening. Also, later on in the learning curve, it makes it more difficult to understand how the network & mask statement in BGP configuration has a fundamentally differend meaning.

14
  • Good answer. The only thing I would add is that there is probably just some factor of the preference of the people who developed the original implementation and then historical inertia that kept it that way until someone decided to do things differently with more recent implementations. It boils down to how it was done first and then how people didn't want to change it because they are used to doing it that way. Commented Apr 28, 2023 at 14:01
  • @Marc'netztier'Luethi Thanks, but I am not sure this addresses my question precisely. I know the benefit of the wildcard mask. But what is the difference if it is not configured? see the updated question. can we even ignore it in ospf as I am sure we can do in eigrp?
    – Shadi
    Commented May 1, 2023 at 18:19
  • I am sure we can do in eigrp? Can you please provide an example/source for that? Commented May 1, 2023 at 18:34
  • @Marc'netztier'Luethi This is A Packet Tracer EIRGP Lab that was created without using wildcard masks.
    – Shadi
    Commented May 2, 2023 at 5:29
  • @Shadi i don't have (nor want to run) packet tracer; can you please edit the question to include your source? Add quoted text if at all possible, screenshots only if there's no alternative. Other than tha: network statements without an explicit wildcard mask will implicitely use the classful mask matching the address class. Once more, the demon of classful adressing comes to haunt us.... Commented May 2, 2023 at 6:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.