步骤一、基本配置
R1(config)#interface e0
R1(config-if)#ip address 10.1.1.1 255.255.255.0
R1(config-if)#ip address 10.1.1.2 255.255.255.0 secondary 设置辅助IP
R1(config-if)#ip address 10.1.1.3 255.255.255.0 secondary
R1(config-if)#ip address 10.1.1.4 255.255.255.0 secondary
R1(config-if)#no keepalive 关闭检测
R1(config-if)#no shutdown
R1(config-if)#interface s0
R1(config-if)#ip address 30.1.1.1 255.255.255.0
R1(config-if)#clock rate 64000
R1(config-if)#no shutdown
R2(config)#interface loopback 0
R2(config-if)#ip address 20.1.1.1 255.255.255.0
R2(config-if)#interface s1
R2(config-if)#ip address 30.1.1.2 255.255.255.0
R2(config-if)#no shutdown
配置路由:
R2(config)#ip route 80.1.1.0 255.255.255.240 serial 1
R1(config)#ip route 0.0.0.0 0.0.0.0 serial 0
R1(config)#access-list 10 permit host 10.1.1.2 定义转换列表
R1(config)#access-list 10 permit host 10.1.1.3
R1(config)#ip nat pool ippool 80.1.1.2 80.1.1.9 prefix-length 28 定义地址池
R1(config)#ip nat inside source list 10 pool ippool 将池和列表关联
R1(config)#access-list 11 permit host 10.1.1.1 PAT转换列表
R1(config)#ip nat inside source list 11 interface serial 0 overload 与接口映射
R1(config)#ip nat inside source static 10.1.1.4 80.1.1.10
R1(config-if)#ip nat inside 加载到接口
R1(config-if)#interface s0
R1(config-if)#ip nat outside 加载到接口
R1#ping
Protocol [ip]:
Target IP address:20.1.1.1
Extended commands [n]: y
Source address or interface: 10.1.1.1
!!!!!
Protocol [ip]:
Target IP address: 20.1.1.1
Extended commands [n]: y
Source address or interface: 10.1.1.2
!!!!!
Protocol [ip]:
Target IP address:20.1.1.1
Extended commands [n]: y
Source address or interface: 10.1.1.3
!!!!!
Pro Inside global Inside local Outside local Outside global
--- 80.1.1.10 10.1.1.4 --- ---
--- 80.1.1.2 10.1.1.2 --- ---
--- 80.1.1.3 10.1.1.3 --- ---
icmp 30.1.1.1:2832 10.1.1.1:2832 20.1.1.1:2832 20.1.1.1:2832
icmp 30.1.1.1:2833 10.1.1.1:2833 20.1.1.1:2833 20.1.1.1:2833
icmp 30.1.1.1:2834 10.1.1.1:2834 20.1.1.1:2834 20.1.1.1:2834
icmp 30.1.1.1:2835 10.1.1.1:2835 20.1.1.1:2835 20.1.1.1:2835
icmp 30.1.1.1:2836 10.1.1.1:2836 20.1.1.1:2836 20.1.1.1:2836
R1#show running-config
hostname R1
!
no ip domain-lookup
!
interface Ethernet0
ip address 10.1.1.2 255.255.255.0 secondary
ip address 10.1.1.3 255.255.255.0 secondary
ip address 10.1.1.4 255.255.255.0 secondary
ip address 10.1.1.1 255.255.255.0
ip nat inside
no keepalive
!
interface Serial0
ip address 30.1.1.1 255.255.255.0
ip nat outside
clockrate 64000
!
ip nat pool ippool 80.1.1.2 80.1.1.9 prefix-length 28
ip nat inside source list 10 pool ippool
ip nat inside source list 11 interface Serial0 overload
ip nat inside source static 10.1.1.4 80.1.1.10
ip route 0.0.0.0 0.0.0.0 Serial0
!
access-list 10 permit 10.1.1.2
access-list 10 permit 10.1.1.3
access-list 11 permit 10.1.1.1
!
line con 0
exec-timeout 0 0
logging synchronous
r2#show running-config
hostname r2
!
interface Loopback0
ip address 20.1.1.1 255.255.255.0
!
interface Serial1
ip address 30.1.1.2 255.255.255.0
!
ip route 80.1.1.0 255.255.255.240 Serial1
line con 0
exec-timeout 0 0
logging