网络实验(六静态路由协议设置)
2013-05-31 10:15
253 查看
实验六:静态路由协议的设置
这个是目前学的最复杂的一个:把路由器和交换机合起来应用:
这个需要好好理理思路:
(一)先在下图上设置网络拓扑图如下:
![](http://img.blog.csdn.net/20130531092659731)
![](http://img.blog.csdn.net/20130531094021850)
选用路由器是选R3620,1sot 选2个因特网口和一个串口的,路由器R1,R2
选取交换机S2950,交换机s1,s2
R1~R2 串口serial0/0 指定数据通信端DCE,R,serial0/0
R1 0/1~s1 0/1.....R2 0/1~S2 0/1
最后添加路由表,r1和r2互通,p1,p2,p3设置好网关,
一共有三个网络,上图已标记清楚,
二;在下图上设置如下:
![](http://img.blog.csdn.net/20130531094059787)
(1)首先设置好路由器,让路由器R1和R2可以想通。
R1: enable
configure terminal
hostname R1
interface serial 0/0
ip address 172.16.2.1 255.255.255.0
clock rate 64000 DCE端
no shutdown
R2:
configure terminal
hostname R1
interface serial 0/0
ip address 172.16.2.2 255.255.255.0
DP端
no shutdown
并测试R1和R2是否可以通信:ping 172.16.2.1
(2)设置网关
R1
enable
configure terminal
interface ehternet 0/0以太网端口
ip address 172.16.1.1 255.255.255.0
no shutdown
PC1
ipconfig /ip 172.16.1.2 255.255.255.0
ipconfig /dg 172.16.1.1 网关的设置,
ipconfig /all
PC2
ipconfig /ip 172.16.1.3 255.255.255.0
ipconfig /dg 172.16.1.1 网关的设置,
ipconfig /all
路由器R2设置如上:
R2
enable
configure terminal
interface ehternet 0/0以太网端口
ip address 172.16.3.1 255.255.255.0
no shutdown
PC3
ipconfig /ip 172.16.3.2 255.255.255.0
ipconfig /dg 172.16.3.1 网关的设置,
ipconfig /all
(3)把交换机s1,s2和网关相连的接口打开,
enable
hostname S1
interface fastethernet 0/1
no shutdown
exit
interface fastethernet 0/2
no shutdown
exit
interface fasethernet 0/3
no shutdown
exit
pc1设置如下:
再次进行测试。
PC1可以和R1通信啦,
pc1, ping 172.16.1.1
由于此时还没有设置路由表信息,所以此时的路由表转发数据报时,只可以存储,无法转发出去,没有路由表。
此时Pc1和pc3无法通信。
(4)这也是本次实验的重点。
添加路由表信息。
pc1~px3切换到全局模式下,ip route 172.16.3.0 255.255.255.0 172.16.2.2
第一个是目的网路号,第二个是目的网路号对应的子网掩码,第三个是到目的网路的下一跳端口。
show ip route
pc3~pc1
ip route 172.16.1.0 255.255.255.0 172.16.2.1
show ip route
进行最后一次的测试:
pc1~pc3:ping 172.16.3.2
pc3~pc1: ping 172.16.1.2
到次结束。
这个是目前学的最复杂的一个:把路由器和交换机合起来应用:
这个需要好好理理思路:
(一)先在下图上设置网络拓扑图如下:
选用路由器是选R3620,1sot 选2个因特网口和一个串口的,路由器R1,R2
选取交换机S2950,交换机s1,s2
R1~R2 串口serial0/0 指定数据通信端DCE,R,serial0/0
R1 0/1~s1 0/1.....R2 0/1~S2 0/1
最后添加路由表,r1和r2互通,p1,p2,p3设置好网关,
一共有三个网络,上图已标记清楚,
二;在下图上设置如下:
(1)首先设置好路由器,让路由器R1和R2可以想通。
R1: enable
configure terminal
hostname R1
interface serial 0/0
ip address 172.16.2.1 255.255.255.0
clock rate 64000 DCE端
no shutdown
r1 Router> Router> Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R1 R1(config)#interface serial 0/0 R1(config-if)#ip address 172.16.2.1 255.255.255.0 R1(config-if)#clock rate 64000 R1(config-if)#no shutdown %LINK-3-UPDOWN: Interface Serial0/0, changed state to up %LINK-3-UPDOWN: Interface Serial0/0, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to down %LINK-3-UPDOWN: Interface Serial0/0, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/0, changed state to up R1(config-if)# R1(config-if)#end R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#interface ethernet 0/0 R1(config-if)#ip address 172.16.1.1 255.255.255.0 R1(config-if)#no shutdown %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up R1(config-if)#exit R1(config)#exit R1#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ip route 172.16.3.0 255.255.255.0 172.16.2.2 R1(config)#exit R1#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route Gateway of last resort is not set 172.16.0.0/24 is subnetted, 3 subnets C 172.16.2.0 is directly connected, Serial0/0 C 172.16.1.0 is directly connected, Ethernet0/0 S 172.16.3.0 [1/0] via 172.16.2.2 R1#
R2:
configure terminal
hostname R1
interface serial 0/0
ip address 172.16.2.2 255.255.255.0
DP端
no shutdown
并测试R1和R2是否可以通信:ping 172.16.2.1
Router> Router> Router>enable Router#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R2 R2(config)#interface serial 0/0 R2(config-if)#no shutdown %LINK-3-UPDOWN: Interface Serial0/0, changed state to up R2(config-if)#ip address 172.16.2.2 255.255.255.0 R2(config-if)#exit R2(config)#exit R2# R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#interface enternet 0/0 R2(config-if)#ip address 172.16.3.1 255.255.255.0 R2(config-if)#no shutdown %LINK-3-UPDOWN: Interface Ethernet0/0, changed state to up R2(config-if)#exit R2(config)#exit R2#configure terminal Enter configuration commands, one per line. End with CNTL/Z. R2(config)#ip route 172.16.1.0 255.255.255.0 172.16.2.1 R2(config)#exit R2#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default U - per-user static route Gateway of last resort is not set 172.16.0.0/24 is subnetted, 3 subnets C 172.16.2.0 is directly connected, Serial0/0 C 172.16.3.0 is directly connected, Ethernet0/0 S 172.16.1.0 [1/0] via 172.16.2.1
(2)设置网关
R1
enable
configure terminal
interface ehternet 0/0以太网端口
ip address 172.16.1.1 255.255.255.0
no shutdown
PC1
ipconfig /ip 172.16.1.2 255.255.255.0
ipconfig /dg 172.16.1.1 网关的设置,
ipconfig /all
PC2
ipconfig /ip 172.16.1.3 255.255.255.0
ipconfig /dg 172.16.1.1 网关的设置,
ipconfig /all
路由器R2设置如上:
R2
enable
configure terminal
interface ehternet 0/0以太网端口
ip address 172.16.3.1 255.255.255.0
no shutdown
PC3
ipconfig /ip 172.16.3.2 255.255.255.0
ipconfig /dg 172.16.3.1 网关的设置,
ipconfig /all
(3)把交换机s1,s2和网关相连的接口打开,
enable
hostname S1
interface fastethernet 0/1
no shutdown
exit
interface fastethernet 0/2
no shutdown
exit
interface fasethernet 0/3
no shutdown
exit
s2 Switch> Switch> Switch> Switch> Switch>enable Switch#configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname R2 R2(config)#interface fastethernet 0/1 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#interface fastethernet 0/2 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#interface fastethernet 0/1 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#interface fastethernet 0/2 R2(config-if)#no shutdown R2(config-if)#exit R2(config)#interface fastethernet 0/3 R2(config-if)#no shutdown R2(config-if)#exit
pc1设置如下:
Press Enter to begin C:> C:>ipconfig /ip 172.16.1.2 255.255.255.0 C:>ipconfig /dg 172.16.1.1 C:>ipconfig /all HELP Manipulates ip address for Workstation. IPCONFIG [/ip] [/dg] /ip Adds the ip address and subnet mask to the workstation /dg Adds the default gateway to the workstation Examples: ¢ ipconfig /ip 157.1.1.12 255.0.0.0 ¢ ipconfig /dg 157.1.1.1 Boson BOSS 5.0 IP Configuration Ethernet adapter Local Area Connection: IP Address. . . . . . . . . . . . : 172.16.1.2 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 172.16.1.1 You can also use winipcfg to configure the IP Address Ethernet adapter Local Area Connection: Description . . . . . . . . . . . : Realtek RTL8139/810X Family PCI Fast Ethernet NIC Physical Address. . . . . . . . . : 000C.8975.3749 C:>ping 172.16.1.1 Pinging 172.16.1.1 with 32 bytes of data: Reply from 172.16.1.1: bytes=32 time=60ms TTL=241 Reply from 172.16.1.1: bytes=32 time=60ms TTL=241 Reply from 172.16.1.1: bytes=32 time=60ms TTL=241 Reply from 172.16.1.1: bytes=32 time=60ms TTL=241 Reply from 172.16.1.1: bytes=32 time=60ms TTL=241 Ping statistics for 172.16.1.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:> C:> C:>ping 172.16.3.2 Pinging 172.16.3.2 with 32 bytes of data: Reply from 172.16.3.2: bytes=32 time=60ms TTL=241 Reply from 172.16.3.2: bytes=32 time=60ms TTL=241 Reply from 172.16.3.2: bytes=32 time=60ms TTL=241 Reply from 172.16.3.2: bytes=32 time=60ms TTL=241 Reply from 172.16.3.2: bytes=32 time=60ms TTL=241 Ping statistics for 172.16.3.2: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>
pc2_____________________________________________________ ress Enter to begin C:> C:> C:>ipconfig /ip 172.16.1.3 255.255.255.0 C:>ipconfig /dg 172.16.1.1 C:>ipconfig /all HELP Manipulates ip address for Workstation. IPCONFIG [/ip] [/dg] /ip Adds the ip address and subnet mask to the workstation /dg Adds the default gateway to the workstation Examples: ¢ ipconfig /ip 157.1.1.12 255.0.0.0 ¢ ipconfig /dg 157.1.1.1 Boson BOSS 5.0 IP Configuration Ethernet adapter Local Area Connection: IP Address. . . . . . . . . . . . : 172.16.1.3 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 172.16.1.1 You can also use winipcfg to configure the IP Address Ethernet adapter Local Area Connection: Description . . . . . . . . . . . : Realtek RTL8139/810X Family PCI Fast
pc3________________________________________ :> C:> C:>ipconfig /ip 172.16.3.2 255.255.255.0 C:>ipconfig /dg 172.16.3.1 C:>ipconfig /all HELP Manipulates ip address for Workstation. IPCONFIG [/ip] [/dg] /ip Adds the ip address and subnet mask to the workstation /dg Adds the default gateway to the workstation Examples: ¢ ipconfig /ip 157.1.1.12 255.0.0.0 ¢ ipconfig /dg 157.1.1.1 Boson BOSS 5.0 IP Configuration Ethernet adapter Local Area Connection: IP Address. . . . . . . . . . . . : 172.16.3.2 Subnet Mask . . . . . . . . . . . : 255.255.255.0 Default Gateway . . . . . . . . . : 172.16.3.1 You can also use winipcfg to configure the IP Address Ethernet adapter Local Area Connection: Description . . . . . . . . . . . : Realtek RTL8139/810X Family PCI Fast Ethernet NIC C:>ping 172.16.3.1 Pinging 172.16.3.1 with 32 bytes of data: Reply from 172.16.3.1: bytes=32 time=60ms TTL=241 Reply from 172.16.3.1: bytes=32 time=60ms TTL=241 Reply from 172.16.3.1: bytes=32 time=60ms TTL=241 Reply from 172.16.3.1: bytes=32 time=60ms TTL=241 Reply from 172.16.3.1: bytes=32 time=60ms TTL=241 Ping statistics for 172.16.3.1: Packets: Sent = 5, Received = 5, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 50ms, Maximum = 60ms, Average = 55ms C:>ping 172.16.1.2 Pinging 172.16.1.2 with 32 bytes of data: Request timed out. Request timed out. Request timed out. Request timed out. Request timed out. Ping statistics for 172.16.1.2: Packets: Sent = 5, Received = 0, Lost = 5 (100% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms
再次进行测试。
PC1可以和R1通信啦,
pc1, ping 172.16.1.1
由于此时还没有设置路由表信息,所以此时的路由表转发数据报时,只可以存储,无法转发出去,没有路由表。
此时Pc1和pc3无法通信。
(4)这也是本次实验的重点。
添加路由表信息。
pc1~px3切换到全局模式下,ip route 172.16.3.0 255.255.255.0 172.16.2.2
第一个是目的网路号,第二个是目的网路号对应的子网掩码,第三个是到目的网路的下一跳端口。
show ip route
pc3~pc1
ip route 172.16.1.0 255.255.255.0 172.16.2.1
show ip route
进行最后一次的测试:
pc1~pc3:ping 172.16.3.2
pc3~pc1: ping 172.16.1.2
到次结束。
相关文章推荐
- 网络Cisco实验-静态路由协议配置
- 套接字类型与协议设置----网络编程(linux----C)
- 使用UDP协议编写一个网络程序,设置接收端程序的监听端口是8001,发送端发送的数据是“Hello, world”。
- 网络工程师交换试验手册之二:静态路由实验
- 基于Cisco Packet Tracer6.0网络协议分析实验第二节
- 无线网络实验之三:无线网络的安全设置--WEP
- 使用UDP协议编写一个网络程序,设置接收端程序监听端口为8001,发送端发送的数据是“hello world”
- 实验六 基于协议的网络编程
- 无线网络实验之四:无线网络的安全设置--WPA
- ntpdate命令_Linux ntpdate 命令用法详解:使用网络计时协议(NTP)设置日期和时间
- 基于CiscoPacket Tracer6.0网络协议分析实验第一节
- CentOS6.5双网卡主机间网络不通问题:设置静态路由
- RHCE 系列(十):在 RHEL/CentOS 7 中设置 NTP(网络时间协议)服务器
- 初级网络实验3:华为S3352三层交换机super密码和新加用户的设置
- 计算机网络实验报告(网络命令、VLAN、静态路由)
- cisco ucs 与 vmware vsphere 5.5 实验五 vcenter网络设置
- 使用UDP协议编写一个网络程序,设置接收端程序的监听端口是8001,发送端发送的数据是“Hello, world”。
- 计算机网络的虚拟局域网,静态路由,RIP路由,NAT实验
- 构建简易网络与网络设备的简单配置(Cisco Packet Tracer)第二弹:静态路由协议配置
- 使用UDP协议编写一个网络程序,设置接收端程序的监听端口是8001,发送端发送的数据是“Hello, world”。