PC1 ip 192.168.1.2/24 192.168.1.1 PC2 ip 192.168.2.3/24 192.168.2.1 PC3 ip 202.106.1.2/24 202.106.1.1 R3 conf t int e1/0 ip add 192.168.1.2 255.255.255.0 ip nat inside no shutdown exit int e1/1 ip add 192.168.2.1 255.255.255.0 ip nat inside no shutdown exit int f0/0 ip add 202.106.0.1 255.255.255.0 ip nat outside no shutdown exit ip route 202.106.1.0 255.255.255.0 202.106.0.2 exit ip nat inside source static 192.168.1.2 202.106.0.3 //外网口外没有占用的主机地址都可以 ip nat inside source static 192.168.2.3 202.106.0.4 exit exit write R1 conf t int f0/0 ip add 202.106.0.2 255.255.255.0 no shutdown exit int f0/1 ip add 202.106.1.1 255.255.255.0 no shutdown exit ip route 202.106.0.0 255.255.255.0 202.106.0.1 exit exit write 验证: