8.网络地址转换NAT配置

拓扑图

1561275815806.png

配置命令

配置端口

Router0

en

conf t

host R0

int fa 0/0

ip address 192.168.1.1 255.255.255.0

no shutdown

exit

int s0/0/0

ip address 222.0.1.1 255.255.255.0

no shutdown

clock rate 64000

exit

Router1

en

conf t

host R1

int s0/0/0

ip address 222.0.1.2 255.255.255.0

no shutdown

exit

int f0/0

ip address 222.0.2.1 255.255.255.0

no shutdown

exit

配置静态路由

Router0

ip route 222.0.2.0 255.255.255.0 222.0.1.2

Router1

ip route 192.168.1.0 255.255.255.0 222.0.1.1

配置Nat

int fa 0/0

设定私有地址连接口

ip nat inside

exit

设置公有地址连接口

int s0/0/0

ip nat outside

exit

设置NAT,实现地址映射

ip nat inside source static 192.168.1.2 222.0.1.3

end

实验结果

Router0:

查看NAT转发表

show ip nat translations

1561276473575.png

使用PC访问NAT转换后的IP地址

1561276544220.png

你可能感兴趣的:(8.网络地址转换NAT配置)