CE配置:
int g0/0
ip address 192.168.1.1 255.255.255.0
ip nat inside
no shut
int s0/3/0
ip address 222.0.1.1 255.255.255.0
ip nat outside
no shut
access-list 1 permit 192.168.1.0 0.0.0.255 ##用ACL去match待转换网段
ip nat pool dalian 222.0.1.10 222.0.1.100 netmask 255.255.255.0 ##nat pool
ip nat inside source list 1 pool dalian ##把ACL和nat pool 关联
ip route 222.0.2.0 255.255.255.0 222.0.1.2
PE配置:
int g0/0
ip address 222.0.2.1 255.255.255.0
no shut
interface Serial0/3/0
ip address 222.0.1.2 255.255.255.0
no shut
ip route 192.168.1.0 255.255.255.0 222.0.1.1
实验结果:
PC1和PC2上ping PE:
PE>
ICMP: echo reply sent, src 222.0.1.2, dst 222.0.1.10
ICMP: echo reply sent, src 222.0.1.2, dst 222.0.1.10
ICMP: echo reply sent, src 222.0.1.2, dst 222.0.1.10
ICMP: echo reply sent, src 222.0.1.2, dst 222.0.1.10
ICMP: echo reply sent, src 222.0.1.2, dst 222.0.1.11
ICMP: echo reply sent, src 222.0.1.2, dst 222.0.1.11
ICMP: echo reply sent, src 222.0.1.2, dst 222.0.1.11
ICMP: echo reply sent, src 222.0.1.2, dst 222.0.1.11