R2的配置:
interface FastEthernet0/0
ip address 100.1.1.2 255.255.255.0
ip nat outside
!
interface FastEthernet0/1
ip address 192.168.1.1 255.255.255.252
ip nat inside
!
router ospf 1
log-adjacency-changes
network 192.168.1.0 0.0.0.3 area 0
default-information originate always
!
ip route 0.0.0.0 0.0.0.0 100.1.1.1
!
ip nat pool nat1 100.1.1.2 100.1.1.2 prefix-length 24
ip nat inside source list 100 pool nat1 overload
ip nat inside source static 192.168.2.1 100.1.1.3
!
access-list 100 permit ip any any
R3的配置:
interface FastEthernet0/1
ip address 192.168.1.2 255.255.255.252
!
interface Ethernet1/0
ip address 192.168.2.254 255.255.255.0
!
interface Ethernet1/1
ip address 192.168.3.254 255.255.255.0
!
router ospf 1
log-adjacency-changes
network 0.0.0.0 255.255.255.255 area 0