网络拓扑:
网络环境:
Router3
:f0/0:10.10.10.1-------PC:10.10.10.10 f0/1:12.1.1.1--------router2:12.1.1.2
Router4
:f0/0:20.20.20.1-------PC:20.20.20.20 f0/1:23.1.1.3--------router2:23.1.1.2
Router2:
f0/0:12.1.1.2
f0/1:23.1.1.2
PC3
: 10.10.10.10
gateway:10.10.10.1
PC4
: 20.20.20.20
gateway:20.20.20.1
Router2:
Router#sho run
Building configuration...
Current configuration : 530 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
interface Loopback0
ip address 11.11.11.11 255.255.255.0(模拟公网环境)
!
interface FastEthernet0/0
ip address 12.1.1.2 255.255.255.0
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 23.1.1.2 255.255.255.0
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip classless
!
!
line con 0
line vty 0 4
login
!
!
!
End
Router3:
Router#sho run
Building configuration...
Current configuration : 829 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
interface Tunnel1
ip address 123.1.1.1 255.255.255.0
tunnel source FastEthernet0/0
tunnel destination 23.1.1.3
!
!
interface FastEthernet0/0
ip address 12.1.1.1 255.255.255.0
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 10.10.10.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
router rip
version 2
network 10.0.0.0
network 123.0.0.0
!
ip nat inside source list 1 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
!
!
access-list 1 permit 10.10.10.0 0.0.0.255
!
!
line con 0
line vty 0 4
login
!
!
!
End
Router4:
Router#sho run
Building configuration...
Current configuration : 829 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
interface Tunnel1
ip address 123.1.1.2 255.255.255.0
tunnel source FastEthernet0/0
tunnel destination 12.1.1.1
!
!
interface FastEthernet0/0
ip address 23.1.1.3 255.255.255.0
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 20.20.20.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
router rip
version 2
network 20.0.0.0
network 123.0.0.0
!
ip nat inside source list 1 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 FastEthernet0/0
!
!
access-list 1 permit 20.20.20.0 0.0.0.255
!
line con 0
line vty 0 4
login
!
!
!
End
转载于:https://blog.51cto.com/2533474/538168