20140917_练习2 实现内网访问internet服务器
1、试验拓扑工程图
路由器R1的配置如下:
Router>enable
Router#config ter
Enter configuration commands, one per line. End with CNTL/Z. Router(config)#host R1
R1(config)#inter f0/1
R1(config-if)#ip ad 200.0.0.1 255.255.255.0
R1(config-if)#no shut
R1(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
R1(config-if)#inter f0/0
R1(config-if)#ip ad 192.168.2.254 255.255.255.0
R1(config-if)#no shut
R1(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
R1(config-if)#ip route 1.1.1.0 255.255.255.0 f0/1
R1(config)#do wr
Building configuration...
[OK]
R1(config)#inter f0/0
R1(config-if)#ip ad 192.168.1.254 255.255.255.0 //添加静态路由
R1(config-if)#do wr
Building configuration...
[OK]
R1(config-if)#
路由器R2的配置如下:
Router>enable
Router#config ter
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host R2
R2(config)#inter f0/0
R2(config-if)#ip add 1.1.1.254 255.255.255.0
R2(config-if)#no shut
R2(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
R2(config-if)#inter f0/1
R2(config-if)#ip add 200.0.0.2 255.255.255.0
R2(config-if)#no shut
R2(config-if)#
R2(config-if)#ip route 192.168.10.0 255.255.255.0 f0/1
R2(config)#do wr
Building configuration...
[OK]
R2(config)#ip route 192.168.1.0 255.255.255.0 f0/1 //添加静态路由
R2(config)#do wr
Building configuration...
[OK]
R2(config)#do ping 192.168.1.254 //测试PingR1网关!//
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.254, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms 3、PC1验证(Ping 1.1.1.1 Intenet):
4、PC2验证(Ping 1.1.1.1 Intenet):。