Tuesday 2 September 2014

IP Unnumbered Explained

In this tutorial we will take a look at IP unnumbered and how to configure it. First of all…what is IP unnumbered and why do we need it?
On a router each interface requires a unique IP address so it can install an entry in the routing table and process IP packets. IP unnumbered allows you to process IP packets without configuring a unique IP address on an interface, this works by “borrowing” an IP address from another interface.
Why would you want this and not just configure an IP address on the interface? To answer that question we have to dive into the past.
Once upon a time we didn’t have VLSM (Variable Length Subnet Mask) and we used classful routing protocols like RIP version 1 and IGRP (the predecessor of EIGRP). This means that the smallest subnet you could use was a /24. When using public IP addresses this is a huge waste of IP space. Take a look at the picture below:
R1 R2 R3 serial links
There are 3 routers connected with each other using point-to-point serial links. We have to use two /24 subnets while we only require 4 IP addresses in total…such a waste!
IP unnumbered was created to solve this problem so you didn’t have to waste entire subnets on point-to-point interfaces. It borrows an IP address from another interface so you don’t have to configure one on the point-to-point interface.



R1 R2 R3 ip unnumbered
Nowadays we can use VLSM to create /30 subnets so we don’t have to waste many IP addresses. We can also use private range IP addresses (if possible in your network) so we don’t need ip unnumbered as much as in the past. Still it can be useful if you quickly want to setup a point-to-point link without worrying about IP addresses and finding a suitable subnet.
Does this make sense so far? Let’s check out the configuration of IP unnumbered. Here’s a simple example with one router:
R1 IP unnumbered
Here’s how to configure IP unnumbered:
R1(config)#interface FastEthernet 0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0

R1(config)#interface Serial 0/0/0
R1(config-if)#ip unnumbered FastEthernet 0/0
The serial interface will borrow the IP address of the FastEthernet interface. Both interfaces will use the same IP address as the same time and will function 100%. We can verify this by using the show ip interface brief command:
R1#show ip interface brief
Interface                  IP-Address      OK? Method Status                Protocol
FastEthernet0/0            192.168.1.1     YES manual up                    up    
FastEthernet0/1            unassigned      YES unset  administratively down down    
Serial0/0/0                192.168.1.1     YES TFTP   down                  up    
Serial0/1/0                unassigned      YES unset  administratively down down
Above you can see that both interfaces are using the same IP address. The serial 0/0/0 interface that is borrowing the IP address is called the “unnumbered interface”.
The interface that you are borrowing the IP address from should be up and running, if not you can’t borrow the IP address. For this reason it’s best to borrow an IP address from a loopback interface. A loopback interface doesn’t go down unless you use the shutdown command or your router crashes…
Also you can’t use IP unnumbered on multi-access interfaces like a Ethernet interface, only on point-to-point interfaces. Here’s what happens when I configure an IP addres on my serial interface and try to borrow it from my FastEthernet interface:
R1(config-if)#default interface FastEthernet 0/0
Interface FastEthernet0/0 set to default configuration

R1(config)#interface Serial 0/0/0              
R1(config-if)#ip address 192.168.1.1 255.255.255.0

R1(config)#interface FastEthernet 0/0 
R1(config-if)#ip unnumbered Serial 0/0/0
Point-to-point (non-multi-access) interfaces only
You can see it fails since the FastEthernet interface is multi-access.
What about routing? are there any problems with IP unnumbered? Not really…let’s look at an example here:
R1 R2 serial link Fastethernet
First we will configure this network where we have an IP address on each interface. I’ll do this so you can see what the routing table looks like normally. Here is the configuration:
R1(config)#interface FastEthernet 0/0
R1(config-if)#ip address 192.168.1.1 255.255.255.0

R1(config)#interface Serial 0/0/0
R1(config-if)#ip address 192.168.12.1 255.255.255.0
R2(config)#interface FastEthernet 0/0
R2(config-if)#ip address 192.168.2.2 255.255.255.0

R2(config)#interface Serial 0/0/0
R2(config-if)#ip address 192.168.12.2 255.255.255.0
Each interface has an IP address, let’s enable a routing protocol:
R1(config)#router eigrp 12      
R1(config-router)#no auto-summary 
R1(config-router)#network 192.168.12.0
R1(config-router)#network 192.168.1.0
R2(config)#router eigrp 12
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.12.0
R2(config-router)#network 192.168.2.0
Now take a look at the routing tables:
R1#show ip route eigrp 
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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

D     192.168.2.0/24 [90/2172416] via 192.168.12.2, 00:00:42, Serial0/0/0
R2#show ip route eigrp 
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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

D     192.168.1.0/24 [90/2172416] via 192.168.12.1, 00:01:04, Serial0/0/0
This is how it is supposed to be, R1 and R2 learn about each others subnet on the FastEthernet interfaces and they use the IP address of the other side of the point-to-point link as the next hop IP address. Now let’s remove the IP addresses on the serial interfaces and use IP unnumbered to borrow the IP address from the FastEthernet interfaces:
R1 R2 ip unnumbered from Fast Ethernet
Let’s look at the configuration:
R1(config)#interface Serial 0/0/0
R1(config-if)#ip unnumbered FastEthernet 0/0
R2(config)#interface Serial 0/0/0
R2(config-if)#ip unnumbered FastEthernet 0/0
Take a look at the routing table now:
R1#show ip route eigrp 
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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

D     192.168.2.0/24 [90/2172416] via 192.168.2.2, 00:01:34, Serial0/0/0
R2#show ip route eigrp 
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
       i - IS-IS, su - IS-IS summary, 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, H - NHRP, l - LISP
       + - replicated route, % - next hop override

Gateway of last resort is not set

D     192.168.1.0/24 [90/2172416] via 192.168.1.1, 00:02:09, Serial0/0/0
This is working fine, no problem at all. You can see each router installs an entry for the subnet on the FastEthernet interface of the other side. The next hop IP address is the borrowed IP address of the other side.
That’s all I have for now, I hope this helps to understand IP unnumbered. If you have any questions, feel free to leave a comment!


No comments:

Post a Comment