本文共 3417 字,大约阅读时间需要 11 分钟。
Gw:
Router>enRouter#configure terminal Enter configuration commands, one per line. End with CNTL/Z.Router(config)#hostname gwgw(config)#interface fastEthernet 0/0gw(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
ip adgw(config-if)#ip address 192.168.10.254 255.255.255.0gw(config-if)#exitgw(config)#interface fastEthernet 0/1gw(config-if)#no shutdown %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to upgw(config-if)#ip address 100.1.1.1 255.255.255.0gw(config-if)#exitgw(config)#SLP-1:
Router>ENRouter#CONFigure Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z.Router SLP-1 (config)#hostname SLP-1SLP-1 (config)#interface fastEthernet 0/0SLP-1 (config-if)#no shutdownSLP-1 (config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
SLP-1 (config-if)#ip address 100.1.1.2 255.255.255.0SLP-1 (config-if)#exitSLP-1 (config)#interface fastEthernet 0/1SLP-1 (config-if)#no shutdownSLP-1 (config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to upSLP-1 (config-if)#ip address 200.1.1.1 255.255.255.0SLP-1 (config)#exitSLP-1#SLP-2:
Router>ENRouter#CONFigure Configuring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z.Router SLP-1 (config)#hostname SLP-2SLP-2 (config)#interface fastEthernet 0/0SLP-2 (config-if)#no shutdownSLP-2 (config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
SLP-2 (config-if)#ip address 200.1.1.2 255.255.255.0SLP-2 (config-if)#exitSLP-2:
SLP-2(config)#router rip \开启ripSLP-2(config-router)#version 2\选择rip版本2SLP-2(config-router)#no auto-summary \关闭自动汇总SLP-2(config-router)#network 200.1.1.0SLP-2(config-router)#exitSLP-2(config)#验证、测试、保存
Gw:show ip nat translation:
debug ip nat :
PC-1:
ping 200.1.1.2Gw:
根据此图可以看出,NAT将一个私有地址转换为公有地址,从而实现了访问的服务。今天就暂时先简单说这些,关于NAT的其他类型会在后面为大家呈现,请大家多多关注!!!!!
转载于:https://blog.51cto.com/13557013/2060468