拓扑:
R1配置(左):
Router#sh run
Building configuration...
Current configuration : 966 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface Tunnel1
ip address 3.3.3.1 255.255.255.0
mtu 1476
tunnel source FastEthernet0/0
tunnel destination 2.2.2.2
!
!
interface FastEthernet0/0
ip address 1.1.1.2 255.255.255.248
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 192.168.100.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip nat inside source list 10 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 1.1.1.1
ip route 174.36.0.0 255.255.0.0 3.3.3.2
ip route 192.168.0.0 255.255.0.0 192.168.100.2
!
ip flow-export version 9
!
!
access-list 10 permit 192.168.0.0 0.0.255.255
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
Router#
R2配置(右):
Router#sh run
Building configuration...
Current configuration : 961 bytes
!
version 12.4
no service timestamps log datetime msec
no service timestamps debug datetime msec
no service password-encryption
!
hostname Router
!
!
!
!
!
!
!
!
ip cef
no ipv6 cef
!
!
!
!
!
!
!
!
!
!
!
!
spanning-tree mode pvst
!
!
!
!
!
!
interface Tunnel1
ip address 3.3.3.2 255.255.255.0
mtu 1476
tunnel source FastEthernet0/0
tunnel destination 1.1.1.2
!
!
interface FastEthernet0/0
ip address 2.2.2.2 255.255.255.248
ip nat outside
duplex auto
speed auto
!
interface FastEthernet0/1
ip address 174.36.10.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
interface Vlan1
no ip address
shutdown
!
ip nat inside source list 10 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 2.2.2.1
ip route 192.168.0.0 255.255.0.0 3.3.3.1
ip route 174.36.0.0 255.255.0.0 174.36.10.2
!
ip flow-export version 9
!
!
access-list 10 permit 174.36.0.0 0.0.255.255
!
!
!
!
!
line con 0
!
line aux 0
!
line vty 0 4
login
!
!
!
end
Router#
Router#
参考配置:
Remote-End#sh run
Building configuration...
Current configuration : 1343 bytes
!
version 12.3
service timestamps debug datetime msec
service timestamps log datetime msec
no service password-encryption
!
hostname Remote-End
!
boot-start-marker
boot-end-marker
!
enable secret 5 ******
enable password ****
!
no network-clock-participate slot 1
no network-clock-participate wic 0
no aaa new-model
ip subnet-zero
ip cef
!
!
!
ip dhcp pool 108
network 192.168.108.0 255.255.255.0
default-router 192.168.108.1
dns-server 114.114.114.114 218.30.19.40 61.34.1.4
lease 30
!
!
!
!
!
!
interface Tunnel1
ip address 1.1.1.2 255.255.255.0
tunnel source 123.138.79.146
tunnel destination 124.17.10.12
!
interface FastEthernet0/0
ip address 123.138.79.146 255.255.255.248
ip nat outside
duplex auto
speed auto
!
interface Serial0/0
no ip address
shutdown
!
interface FastEthernet0/1
ip address 192.168.108.1 255.255.255.0
ip nat inside
duplex auto
speed auto
!
ip nat inside source list 10 interface FastEthernet0/0 overload
ip classless
ip route 0.0.0.0 0.0.0.0 123.138.79.145
ip route 192.168.2.0 255.255.255.0 Tunnel1
ip route 192.168.3.0 255.255.255.0 Tunnel1
ip route 192.168.4.0 255.255.255.0 Tunnel1
ip route 199.189.127.0 255.255.255.0 Tunnel1
ip http server
!
access-list 10 permit 192.168.108.0 0.0.0.255
!
line con 0
line aux 0
line vty 0 4
password *******
login
!
!
end
Remote-End#