本文共 4080 字,大约阅读时间需要 13 分钟。
实验名称:思科路由动态PNAT配置
实验拓扑:实验环境:1、3台路由器,2、一台交换机Router 0 边界路由器(内网和外网)Router 1 边界路由器(公网的内网和外网)Pouter 2 内网路由器 (公网的内部网络)3、两台PC Pc2 pc3实验思路:先把三台路由器的地址配置好,
Router0 g0/0口是内网网关 192.168.1.254/24Router0 g0/1口是公网地址 100.1.1.1/24Router1 g0/0是公网外网地址 100.1.1.2/24 Router1 g0/1 是公网内网网关 200.1.1.1/24 Router2 g0/0 是公网内网地址 200.1.1.2/24
实验步骤:
1、 配置PC机地址:Pc2:IP : 192.168.10.1/24网关:192.168.10.254Pc3IP : 192.168.10.2/24网关:192.168.10.2542、 配置Router 0Continue with configuration dialog? [yes/no]: noPress RETURN to get started!
Router>enable
Router#Router#configureConfiguring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int g0/0Router(config-if)#no shtdown^% Invalid input detected at '^' marker.Router(config-if)#Router(config-if)#no shutdownRouter(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)#ip address 192.168.10.254 255.255.255.0
Router(config-if)#eRouter(config)#int g0/1Router(config-if)#no shutdownRouter(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to upRouter(config-if)#ip address 100.1.1.1 255.255.255.0
Router(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to upRouter(config-if)#e
Router(config)#int g0/0Router(config-if)#ip nat iRouter(config-if)#ip nat inside Router(config-if)#eRouter(config)#int g0/1Router(config-if)#ip nat oRouter(config-if)#ip nat outside Router(config-if)#Router(config-if)#Router(config-if)#Router(config-if)#eRouter(config)#Router(config)#Router(config)#Router(config)#Router(config)#acceRouter(config)#access-list 1 pRouter(config)#access-list 1 permit 192.168.10.0 0.0.0.255Router(config)#ip nat iRouter(config)#ip nat inside sRouter(config)#ip nat inside source lRouter(config)#ip nat inside source list 1 interface g0/1Router(config)#Router(config)#Router(config)#ip route 0.0.0.0 0.0.0.0 100.1.1.2Router(config)#3、 配置Router1Continue with configuration dialog? [yes/no]: noPress RETURN to get started!
Router>enable
Router#configureConfiguring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int g0/0Router(config-if)#no shutdownRouter(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)#ip address 100.1.1.2 255.255.255.0
Router(config-if)#eRouter(config)#int g0/1Router(config-if)#no shutdownRouter(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to upRouter(config-if)#ip address 200.1.1.1 255.255.255.0
Router(config-if)#%LINEPROTO-5-UPDOWN: Line protocol on Interface GigabitEthernet0/1, changed state to upRouter(config-if)#
Router(config-if)#eRouter(config)#route ripRouter(config-router)#version 2Router(config-router)#no auto-summaryRouter(config-router)#network 200.1.1.0Router(config-router)#network 100.1.1.0Router(config-router)#pRouter(config-router)#passive-interface g0/0Router(config-router)#4、 配置Router 2Continue with configuration dialog? [yes/no]: noPress RETURN to get started!
Router>enable
Router#configureConfiguring from terminal, memory, or network [terminal]? Enter configuration commands, one per line. End with CNTL/Z.Router(config)#int g0/0Router(config-if)#no shutdownRouter(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)#ip address 200.1.1.2 255.255.255.0
Router(config-if)#eRouter(config)#route ripRouter(config-router)#version 2Router(config-router)#no auto-summaryRouter(config-router)#network 200.1.1.0Router(config-router)#5、验证思路:全部配置好先ping自己的网关在一步一步ping到公网的内网转载于:https://blog.51cto.com/13467772/2060476