1. 程式人生 > >思科路由靜態NAT配置

思科路由靜態NAT配置

log proto enter route ext inter alt outside 實驗

實驗名稱:思科路由靜態NAT配置
實驗拓撲:技術分享圖片
實驗環境:1、3臺路由器,
2、一臺交換機
Router 0 邊界路由器(內網和外網)
Router 1 邊界路由器(公網的內網和外網)
Pouter 2 內網路由器 (公網的內部網絡)
3、一臺PC

實驗步驟:
1、 配置PC機地址:
IP : 192.168.10.1/24
網關:192.168.10.25
2、 配置Router 0
Continue with configuration dialog? [yes/no]: n

Press RETURN to get started!
Router>
Router>
Router>enable
Router#
Router#

Router#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int g0/0
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/0, changed state to up

Router(config-if)#
Router(config-if)#ip add 19.168.10.254 255.255.255.0
Router(config-if)#q
^
% Invalid input detected at ‘^‘ marker.
Router(config-if)#e
Router(config)#int g0/1
Router(config-if)#no shutdown

Router(config-if)#ip add 100.1.1.1 255.255.255.0
Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

Router(config-if)#
Router(config-if)#
Router(config-if)#e
Router(config)#int g0/0
Router(config-if)#ip nat inside
Router(config-if)#e
Router(config)#int g0/1
Router(config-if)#ip nat outside
Router(config-if)#e
Router(config)#ip nat i
Router(config)#ip nat inside s
Router(config)#ip nat inside source s
Router(config)#ip nat inside source static 192.168.10.1 100.1.1.1
Router(config)#int g0/0
Router(config-if)#ip add 192.168.10.254 255.255.255.0
Router(config-if)#e
Router(config)#ip route 0.0.0.0 0.0.0.0 100.1.1.2
Router(config)#ip route 0.0.0.0 0.0.0.0 100.1.1.2
Router(config)#
3、 配置Router1
Continue with configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>
Router>
Router>
Router>enable
Router#
Router#
Router#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Router(config)#int g0/1
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to up

Router(config-if)#
Router(config-if)#ip add 100.1.1.2 255.255.255.0
Router(config-if)#e
Router(config)#int g0/2
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up

Router(config-if)#ip add 200.1.1.1 255.255.255.0
Router(config-if)#e
Router(config)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up

Router(config)#
Router(config)#
Router(config)#route rip
Router(config-router)#net
Router(config-router)#network 100.1.1.0
Router(config-router)#net
Router(config-router)#network 200.1.1.0
Router(config-router)#pa
Router(config-router)#passive-interface g0/1
Router(config-router)#
4、 配置Router 2
Continue with configuration dialog? [yes/no]: no

Press RETURN to get started!

Router>
Router>
Router>
Router>enable
Router#
Router#
Router#configure
Configuring from terminal, memory, or network [terminal]?
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#
Router(config)#
Router(config)#int g0/2
Router(config-if)#no shutdown

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/2, changed state to up

%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/2, changed state to up

Router(config-if)#ip add 200.1.1.2 255.255.255.0
Router(config-if)#
Router(config-if)#
Router(config-if)#
Router(config-if)#
Router(config-if)#e
Router(config)#route rip
Router(config-router)#net
Router(config-router)#network 200.1.1.0
Router(config-router)#
5、 驗證測試:

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

技術分享圖片

思科路由靜態NAT配置