Thursday, August 23, 2012

Advertise default route under OSPF



In this example I will explain where and how to advertise default route under ospf process to send to other ospf routers.
From diagram you can see topology, it's not complex but is good for this purpose.
First I will list configuration of router R1 and R2 and configuration itself from both routers.

R1 is configured for:

- NAT overload
- Serial interface S1/0 as NAT inside with IP address 10.150.20.1/30, and interface on ISP direction with NAT outside with IP received from ISP DHCP server.
- OSPF routing protocol advertising on interface S1/0 or specific IP address 10.150.20.1/30

!
hostname R1
!
ip domain name lab.local
ip name-server 4.2.2.2
ip name-server 192.168.1.1
!
interface FastEthernet0/0
 ip address dhcp
 ip nat outside
 duplex auto
 speed auto
!
interface Serial1/0
 ip address 10.150.20.1 255.255.255.252
 ip nat inside
 clock rate 64000
!        
router ospf 1
 network 10.150.20.1 0.0.0.0 area 0
!
!        
ip nat inside source list NAT_ADDRESSES interface FastEthernet0/0 overload
!
ip access-list standard NAT_ADDRESSES
 permit 192.168.10.0 0.0.0.255
!
end

There is no command for static route because I received that route from my Linksys which I'm using for access the Internet. Addition: I read that if interface which have enabled ip address dhcp router will automatically learn default route, which is case in this example.
S*   0.0.0.0/0 [254/0] via 10.143.88.254 -- Linksys IP address