1、路由与交换实习实验报告参考实验报告【实验网络拓扑结构】【实验目的】 1.实现校园网网络连通 1)利用静态路由实现汇聚交换机和路由器与核心路由器间连通 2)利用rip实现部汇聚交换机与核心路由器间连通 3)利用ospf实现汇聚路由器与核心路由器连通 4)通过设置单臂路由使教学楼1和教学楼2能互相连通 5)对学生宿舍楼和教学楼分别划分vlan 2.在核心路由器上实现nat转换,使部网络能访问internet 3.设置标准acl规则:禁止外部用户访问部网络 4.设置扩展acl规则:仅允许部用户访问数据中心的80,21端口6.在核心路由与出口路由间运用ppp协议配置 最后要求将检测结果放入一个WORD
2、文档中,文件名为 :学号-大作业.DOC中 给出网络互通的效果,将PING截图 在各网络设备上,用SHOW RUN命令 对交换机,还要求SHOW VLAN, show int ip switchport 对路由器,还要求SHOW IP ROUTE 对NAT ,要求用PING T ,及DEBUG IP NAT 对ACL, 要求检测相关口或VLAN的ACL表,SHOW IP INT 端口号【实验中运用的知识点】1)静态路由2)Rip3)Ospf4)nat转换5)标准访问控制列表规则6)扩展访问控制列表规则7)划分vlan8)单臂路由9)广域网协议ppp【实验配置步骤】第一部分 配置部网络连通注意:
3、配置中省略了各端口的ip配置,相信端口ip可以从拓扑图中反应1)接入交换机1配置划分vlanSwitch(config)#int fa0/2Switch(config-if)#switchport access vlan Switch(config-if)#switchport access vlan 2Switch(config)#int fa0/3Switch(config-if)#switchport access vlan 3Switch(config)#int fa0/1Switch(config-if)#switchport trunk encapsulation dot1q (2
4、960等交换机只支持802.1q协议,这里忽略)Switch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan all Switch(config-if)#exit 2)汇聚路由器配置设置单臂路由Router(config)#interface fa0/0.1配置 子接口 这是配置单臂路由的关键,这个接口是个 逻辑接口,并不是实际存在的物理接口,但是功能却和物理接口是一样的。 Router(config-subif)#encapsulation dot1q 2 为这个接口配置802.
5、1Q协议,最后面的 2 是vlan 号,这也是关键部分 Router(config-subif)#ip address 192.168.2.254 255.255.255.0 为该接口划分ip地址。 Router(config-subif)#exit Router(config)#interface fa0/0.2 Router(config-subif)#encapsulation dot1q 3 .Router(config-subif)#ip address 192.168.3.254 255.255.255.0 Router(config-subif)#end 设置ospfRouter
6、(config)#router ospf 100Router(config-router)#network 192.168.3.0 0.0.0.255 area 0Router(config-router)#network 192.168.4.0 0.0.0.255 area 0设置静态路由Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.4.1013)接入交换机2配置创建vlan4 vlan5Switch(config)#int vlan4Switch(config)#int vlan5Switch(config)#int fa0/2Switch
7、(config-if)#switchport access vlan 4Switch(config)#int fa0/3Switch(config-if)#switchport access vlan 54)汇聚交换机配置为vlan4和vlan5设置sviSwitch(config)#int vlan 4Switch(config-if)#ip address 172.16.2.254Switch(config)#int vlan 5Switch(config-if)#ip address 172.16.3.254设置trunkSwitch(config)#int fa0/1Switch(co
8、nfig-if)#switchport mode trunk 设置ripSwitch(config)#router ripSwitch(config-router)#network 172.16.0.0设置静态路由Router(config)#ip route 0.0.0.0 0.0.0.0 172.16.4.1015)核心路由器配置设置静态路由Router(config)#ip route 0.0.0.0 0.0.0.0 192.168.4.100Router(config)#ip route 0.0.0.0 0.0.0.0 172.16.4.100设置ripRouter(config)#r
9、outer ripRouter(config-router)#network 192.168.4.0Router(config-router)#network 172.16.0.0设置ospfRouter(config)#router ospf 100Router(config-router)#network 192.168.4.0 0.0.0.255 area 06)汇聚交换机2配置设置静态路由Switch(config)#ip route 0.0.0.0 0.0.0.0 10.1.2.101至此,部网络均能互相连通,接下来我们先配置nat使网可以连通外网第二部分 设置nat转换,使部用户能
10、访问外部网络核心路由器(nat)配置Router(config)#int fa0/0Router(config-if)#ip nat inside /将该接口标记为部接口Router(config)#int fa1/0Router(config-if)#ip nat inside /将该接口标记为部接口Router(config)#int fa7/0 /将该接口标记为部接口Router(config-if)#ip nat insideRouter(config)#int se2/0Router(config-if)#ip nat outside /将该接口标记为外部接口Router(confi
11、g)#access-list 10 permit 192.168.4.0 0.0.0.255Router(config)#access-list 10 permit 192.168.2.0 0.0.0.255Router(config)#access-list 10 permit 192.168.3.0 0.0.0.255Router(config)#access-list 10 permit 172.16.0.0 0.0.255.255Router(config)#access-list 10 permit 172.16.0.0 0.0.255.255Router(config)#acces
12、s-list 10 permit 10.1.2.0 0.0.0.255Router(config)#access-list 10 permit 10.1.1.0 0.0.0.255/定义标准访问控制列表10只允许定义的地址能够被转换Router(config)#ip nat pool out 202.121.241.10 202.121.241.20 netmask 255.255.255.0/定义名称为out的地址池。Router(config)#ip nat inside source list 10 pool out/将访问控制列表定义的地址和地址池关联这样就有前部主机能够得到公网地址。
13、第三部分 设置acl规则首先设置出口路由器和核心路由器使外部网络与部网络连通出口路由器配置设置静态路由Router(config)#ip route 0.0.0.0 0.0.0.0 202.121.241.8核心路由器配置设置静态路由Router(config)#ip route 0.0.0.0 0.0.0.0 202.121.241.100在出口路由器上做如下配置设置标准访问控制列表规则如下:1) 禁止外部用户访问部网络Router(config)#access-list 11 deny anyRouter(config)#int fa0/0Router(config-if)#ip acce
14、ss-group 11 in在核心路由器上做如下配置设置扩展访问控制列表规则如下2) 仅允许部用户访问数据中心的80,21端口Router(config)#ip access-list extended testRouter(config-ext-nacl)#permit tcp any any eq 80Router(config-ext-nacl)#permit tcp any any eq 21Router(config-ext-nacl)#deny ip any anyRouter(config)#int fa7/0Router(config-if)#ip access-group t
15、est out第四部分 广域网协议ppp设置出口路由器配置Router(config)#hostname R1R1(config)#username R2 password zglR1(config)#int se2/0R1(config-if)#en ppp R1(config-if)#ppp authentication chap核心路由器配置Router(config)#hostname R2R2(config)#username R1 password zglR2(config)#interface se2/0R2(config-if)#en ppp【实验检测】网络互通测试截图如下:教
16、学楼到汇聚路由器教学楼到核心路由器教学楼到宿舍楼教学楼到数据中心教学楼到外部网络宿舍楼到教学楼宿舍楼到数据中心宿舍楼到外部网络外部网络到教学楼外部网络到宿舍楼外部网络到数据中心Nat转换测试:在核心路由器上debug ip nat截图如下:Acl规则测试在核心路由器Show ip 端口、Router#show ip interface fa7/0FastEthernet7/0 is up, line protocol is up (connected) Internet address is 10.1.2.101/8 Broadcast address is 255.255.255.255 A
17、ddress determined by setup command MTU is 1500 Helper address is not set Directed broadcast forwarding is disabled Outgoing access list is test Inbound access list is not set Proxy ARP is enabled Security level is default Split horizon is enabled ICMP redirects are always sent ICMP unreachables are
18、always sent ICMP mask replies are never sent IP fast switching is disabled IP fast switching on the same interface is disabled IP Flow switching is disabled IP Fast switching turbo vector IP multicast fast switching is disabled IP multicast distributed fast switching is disabled Router Discovery is
19、disabled IP output packet accounting is disabled IP access violation accounting is disabled TCP/IP header compression is disabled RTP/IP header compression is disabled Probe proxy name replies are disabled Policy routing is disabled Network address translation is disabled WCCP Redirect outbound is d
20、isabled WCCP Redirect exclude is disabled BGP Policy Mapping is disabled在出口路由器Show ip 端口Router#show ip interface fa0/0FastEthernet0/0 is up, line protocol is up (connected) Internet address is 219.220.240.100/24 Broadcast address is 255.255.255.255 Address determined by setup command MTU is 1500 Hel
21、per address is not set Directed broadcast forwarding is disabled Outgoing access list is not set Inbound access list is 11 Proxy ARP is enabled Security level is default Split horizon is enabled ICMP redirects are always sent ICMP unreachables are always sent ICMP mask replies are never sent IP fast
22、 switching is disabled IP fast switching on the same interface is disabled IP Flow switching is disabled IP Fast switching turbo vector IP multicast fast switching is disabled IP multicast distributed fast switching is disabled Router Discovery is disabled IP output packet accounting is disabled IP
23、access violation accounting is disabled TCP/IP header compression is disabled RTP/IP header compression is disabled Probe proxy name replies are disabled Policy routing is disabled Network address translation is disabled WCCP Redirect outbound is disabled WCCP Redirect exclude is disabled BGP Policy
24、 Mapping is disabled在汇聚路由及核心路由上show ospf neighbor核心路由器上show run,show ip routerR2#show runBuilding configuration.Current configuration : 1724 bytes!version 12.2no service timestamps log datetime msecno service timestamps debug datetime msecno service password-encryption!hostname R2!username R1 passwo
25、rd 0 zgl!interface FastEthernet0/0 ip address 192.168.4.101 255.255.255.0 ip nat inside duplex auto speed auto!interface FastEthernet1/0 ip address 172.16.4.101 255.255.255.0 ip nat inside duplex auto speed auto!interface Serial2/0 ip address 202.121.241.8 255.255.255.0 encapsulation ppp ppp authent
26、ication chap ip nat outside clock rate 64000!interface Serial3/0 no ip address shutdown!interface FastEthernet4/0 no ip address shutdown!interface FastEthernet5/0 no ip address shutdown!interface GigabitEthernet6/0 no ip address duplex auto speed auto shutdown!interface FastEthernet7/0 ip address 10
27、.1.2.101 255.0.0.0 ip access-group test out ip nat inside duplex auto speed auto!router ospf 100 log-adjacency-changes network 192.168.4.0 0.0.0.255 area 0!router rip network 172.16.0.0 network 192.168.4.0!ip nat pool out 202.121.241.10 202.121.241.20 netmask 255.255.255.0ip nat inside source list 1
28、0 pool outip classlessip route 0.0.0.0 0.0.0.0 192.168.4.100 ip route 0.0.0.0 0.0.0.0 172.16.4.100 ip route 0.0.0.0 0.0.0.0 202.121.241.100 !access-list 10 permit 192.168.4.0 0.0.0.255access-list 10 permit 192.168.2.0 0.0.0.255access-list 10 permit 192.168.3.0 0.0.0.255access-list 10 permit 172.16.0
29、.0 0.0.255.255access-list 10 permit 10.1.2.0 0.0.0.255access-list 10 permit 10.1.1.0 0.0.0.255ip access-list extended test permit tcp any any eq permit tcp any any eq ftp deny ip any any!no cdp run!line con 0line vty 0 4 loginEndR2#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M
30、 - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 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, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static routeGateway of last resort is 172.16.4.100 to network 0.0.0.0C 10.0.0.0/8 is directly connected, FastEthernet7/0 172.16.0.0/24 is subnetted, 3 subnetsR 172.16.2.0
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1