Cisco CCNA (200-301)IP ConnectivityHard
A network administrator is configuring OSPFv2 on a router. The router has an interface GigabitEthernet0/0 with the IP address `192.168.50.1/27`. To enable OSPF on this interface and include it in area 0, which `network` command should be used under the OSPF router configuration mode?
- A`network 192.168.50.1 255.255.255.224 area 0`
- B`network 192.168.50.0 0.0.0.7 area 0`
- C`network 192.168.50.0 0.0.0.31 area 0`
- D`network 192.168.50.1 0.0.0.0 area 0`
Show answer & explanationAnswer & explanation
Correct answer: C. `network 192.168.50.0 0.0.0.31 area 0`
To enable OSPF on an interface, the `network` command specifies the network address and a wildcard mask. The interface's IP address `192.168.50.1/27` belongs to the network `192.168.50.0/27`. The wildcard mask for a /27 subnet (255.255.255.224) is calculated by subtracting the subnet mask from 255.255.255.255: `255.255.255.255 - 255.255.255.224 = 0.0.0.31`.
Why the other options are wrong
- A. The `network` command uses a wildcard mask, not a subnet mask.
- B. A wildcard mask of 0.0.0.7 corresponds to a /29 subnet, not /27.
- D. This command uses the interface IP as the network address and a host wildcard mask (0.0.0.0), which only enables OSPF on that specific IP, not the entire subnet if other hosts are present.
OSPF Wildcard Mask Calculation
An OSPF wildcard mask is the inverse of a subnet mask, used in the `network` command to specify which interfaces belong to an OSPF area.
- Calculated by subtracting the subnet mask from 255.255.255.255.
- A '0' in the wildcard mask means 'match this octet exactly'.
- A '255' in the wildcard mask means 'match any value in this octet'.
- Used to match a range of IP addresses for OSPF activation.
Memory trick: Network and Wildcard: the mask's inverse, to make OSPF traverse.