拓年如图,希望R1和R2的环回口可以到达s0/0口,R1和R2 R3的F0/0之间跑的是ospf,可以相互ping通,在R3的f0/0做为inside,s0/0做为outside,R3的配置如下:
hostname R3
!
boot-start-marker
boot-end-marker
!
!
no aaa new-model
memory-size iomem 5
ip cef
!
!
!
!
no ip domain lookup
ip domain name lab.local
!
multilink bundle-name authenticated
!
!
!
!
!
!
!
!
!
!
!
interface FastEthernet0/0
ip address 192.168.1.3 255.255.255.0
ip nat inside
ip virtual-reassembly
duplex auto
speed auto
!
interface Serial0/0
ip address 198.50.1.1 255.255.255.252
ip nat outside
ip virtual-reassembly
clock rate 2000000
!
interface FastEthernet0/1
no ip address
shutdown
duplex auto
speed auto
!
interface Serial0/1
no ip address
shutdown
clock rate 2000000
!
router ospf 1
router-id 91.1.1.3
log-adjacency-changes
network 192.168.1.0 0.0.0.255 area 0
!
ip route 0.0.0.0 0.0.0.0 Serial0/0
!
!
no ip http server
no ip http secure-server
ip nat pool internet 198.50.1.1 198.50.1.2 netmask 255.255.255.252
ip nat inside source list 1 pool internet overload
!
access-list 1 permit any
!
!
!
!
!
control-plane
!
!
!
line con 0
exec-timeout 0 0
privilege level 15
logging synchronous
line aux 0
exec-timeout 0 0
privilege level 15
logging synchronous
line vty 0 4
login
!
!
end