路由交换-实训当前进度 1.22更好的阅读和更新地址: https://blog.dayi.ink/?p=59更好的阅读和更新地址: https://type.dayiyi.top/index.php/archives/189/非常感谢一些小伙伴的帮助哦【dayi的大键盘】新的博客：https://blog.dayi.ink ，欢迎来体验新的阅读。更新中修改的内容2023年6月25日17:32:08 在0x30中提示 0x48 中Area2的stub模式的配置，0x22 中Core的交换机配置和截图有所偏差，已经添加正确的 2023年6月25日17:59:01 0x21 修复截图 2023年6月25日18:13:18 0x31 小修 2023年6月25日20:40:00 ！！！！如果你发现配完单臂路由之后不通，请使用这个方法：在Core交换机上config模式下输入 Core(config)#vlan 10 ，然后再输入 Core(config)#vlan 20 即可。估计是，在火车上，文件估计是没提交成功到服务器，现在已经修改。 原因应该是：转发VLAN的交换机必须要有全部的VLAN表，实际上可以通过交换机配置VLAN表服务器同步来解决，但是因为就3个交换机，每个都手动配，也挺简单滴。已经在0x22修复。交换机是通过Allowed VLAN List来控制是否允许某个VLAN的报文通过TRUNK端口，只有VLAN在List里，才允许通过TRUNK端口。 2023年6月25日20:58:44: 1.21 : 小修2023年6月25日20:40:00 0x22 ver:1.20 update:0x00 准备文件综合实践PKT文件https://p.dabbit.net/blog/pic_bed/%E7%BB%BC%E5%90%88%E5%AE%9E%E9%AA%8C_1bce0e92-e21c-4ee6-957e-7d4614f66918.pkt0x01 需求需求：1、按图搭建实验环境，并配置IP地址交换部分：2、分支1内部有两个部门，ylan10是技术部，vlan20是研发部。配置相应的vlan。3、两个vlan的网关都在路由器RO上，用单臂路由技术实现。4、交换机之间及Core到RO之间需要配置trunk，且出于安全考虑只允许vlan10和20通过。5、S1作为vlan10的STP的根桥，S2作为VLAN20的STP根桥。路由部分：6、互联网区使用OSPF协议。R1／2／3作为area0区，R2／3／4作为Area1区，R3／5作为Area2区7、RO和R6作为企业边界设备，为了上网需要配置默认路由。其它部分：8、公网DNS服务器为分支1提供DNS解析服务。9、分支2的web服务器为分支一提供web访问服务。10、分支一需要配置端口地址转换（PNAT）实现内部主机上网。但是为了避免代码泄露，研发部门不允许上网。11、分之二需要配置端口映射（DNAT），提供对外的web服务。域名www．自己的名字拼音．com。0x02 打开文件打开文件就可以啦PVP。就是那个综合实践PKT文件。0x10 配置IP 按图搭建实验环境，并配置IP地址DNS 200.1.1.233/24网关:200.1.1.1PC0 192.168.1.233/24网关192.168.1.1DNS:200.1.1.233PC1 192.168.2.233/24网关192.168.2.1DNS:200.1.1.233WEB172.16.1.233/24(255.255.255.0)网关：172.16.1.1DNS：200.1.1.2330x20 交换部分交换部分：2、分支1内部有两个部门，ylan10是技术部，vlan20是研发部。配置相应的vlan。3、两个vlan的网关都在路由器RO上，用单臂路由技术实现。4、交换机之间及Core到RO之间需要配置trunk，且出于安全考虑只允许vlan10和20通过。5、S1作为vlan10的STP的根桥，S2作为VLAN20的STP根桥。0x21 划分VLAN分支1内部有两个部门，ylan10是技术部，vlan20是研发部。配置相应的vlan。把两个交换机划分两个VLAN下。交换机S1_VLAN10：192.168.1.11交换机S1_VLAN20: 192.168.2.11交换机S2_VLAN10: 192.168.1.12交换机S2_VLAN20: 192.168.2.12交换机Core_VLAN10: 192.168.1.13交换机Core_VLAN20: 192.168.2.13S1交换机部分Switch>en Switch#conf t Switch(config)#vlan 10 Switch(config-vlan)#name tech_dep Switch(config-vlan)#int vlan10 Switch(config-if)#ip addr 192.168.1.11 255.255.255.0 Switch(config-if)#no shut Switch(config-if)#int f0/3 Switch(config-if)#switchport mode access Switch(config-if)#switchport access vlan 10 Switch(config-if)#hostname S1 S1(config)#vlan 20 S1(config-vlan)#name research_dep S1(config-vlan)#int vlan 20 S1(config-if)#ip addr 192.168.2.11 255.255.255.0 S1(config-if)#no shut # 才学的新命令 S1(config-if)#do show vlan brief VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/1, Fa0/2, Fa0/4, Fa0/5 Fa0/6, Fa0/7, Fa0/8, Fa0/9 Fa0/10, Fa0/11, Fa0/12, Fa0/13 Fa0/14, Fa0/15, Fa0/16, Fa0/17 Fa0/18, Fa0/19, Fa0/20, Fa0/21 Fa0/22, Fa0/23, Fa0/24, Gig0/1 Gig0/2 10 tech_dep active Fa0/3 20 research_dep active 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active S2 交换机部分Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10 Switch(config-vlan)#name tech_dep Switch(config-vlan)#vlan 20 Switch(config-vlan)#name research_dep Switch(config-vlan)#hostname S2 S2(config)#int vlan10 S2(config-if)#ip addr 192.168.1.12 255.255.255.0 S2(config-if)#no shut S2(config-if)#int vlan20 S2(config-if)#ip addr 192.168.2.12 255.255.255.0 S2(config-if)#no shut S2(config-if)#int f0/3 S2(config-if)#switchport mode access S2(config-if)#switchport access vlan 20 S2(config)#do show vlan brief VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7 Fa0/8, Fa0/9, Fa0/10, Fa0/11 Fa0/12, Fa0/13, Fa0/14, Fa0/15 Fa0/16, Fa0/17, Fa0/18, Fa0/19 Fa0/20, Fa0/21, Fa0/22, Fa0/23 Fa0/24, Gig0/1, Gig0/2 10 tech_dep active 20 research_dep active Fa0/3 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active S2(config)#对于show vlan brief看下面这个图啦，下面的图是正确的0x22 配置TrunkS1S1#conf t Switch(config)#vlan 10 Switch(config-vlan)#name tech_dep Switch(config-vlan)#vlan 20 Switch(config-vlan)#name research_dep S1(config)#int f0/1 S1(config-if)#switchport mode trunk S1(config-if)#switchport trunk allowed vlan 10,20 S1(config-if)#int f0/2 S1(config-if)#switchport mode trunk S1(config-if)#switchport trunk allowed vlan 10,20 S1(config-if)#do show int trunk Port Mode Encapsulation Status Native vlan Fa0/1 on 802.1q trunking 1 Fa0/2 on 802.1q trunking 1 Port Vlans allowed on trunk Fa0/1 10,20 Fa0/2 10,20 Port Vlans allowed and active in management domain Fa0/1 10,20 Fa0/2 10,20 Port Vlans in spanning tree forwarding state and not pruned Fa0/1 10,20 Fa0/2 none Switch(config-vlan)#hostname CoreS2 同理S2(config-if)#int f0/1 S2(config-if)#switchport mode trunk S2(config-if)#switchport trunk allowed vlan 10,20 S2(config-if)#int f0/2 S2(config-if)#switchport mode trunk S2(config-if)#switchport trunk allowed vlan 10,20 S2(config-if)#do show int trunk Port Mode Encapsulation Status Native vlan Fa0/1 on 802.1q trunking 1 Fa0/2 on 802.1q trunking 1 Port Vlans allowed on trunk Fa0/1 10,20 Fa0/2 10,20 Port Vlans allowed and active in management domain Fa0/1 10,20 Fa0/2 10,20 Port Vlans in spanning tree forwarding state and not pruned Fa0/1 10,20 Fa0/2 20Coreno Switch>en Switch#conf t Switch(config)#int f0/1 Switch(config-if)#switchport mode trunk Command rejected: An interface whose trunk encapsulation is "Auto" can not be configured to "trunk" mode. Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 10,20 Switch(config-if)#int f0/2 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 10,20 Switch(config-if)#int f0/3 Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunk Switch(config-if)#switchport trunk allowed vlan 10,20 Switch(config)#int vlan10 Switch(config-if)#ip addr 192.168.1.13 255.255.255.0 Switch(config-if)#no shut Switch(config-if)#int vlan20 Switch(config-if)#ip addr 192.168.2.13 255.255.255.0 Switch(config-if)#no shut <---添加的内容---> Switch(config-if)#vlan 10 Switch(config-vlan)#vlan 20 Switch(config-vlan)#ex <---添加的内容---> Switch(config-if)#do show int trunk Core#show int trunk Port Mode Encapsulation Status Native vlan Fa0/1 on 802.1q trunking 1 Fa0/2 on 802.1q trunking 1 Fa0/3 on 802.1q trunking 1 Port Vlans allowed on trunk Fa0/1 10,20 Fa0/2 10,20 Fa0/3 10,20 Port Vlans allowed and active in management domain Fa0/1 10,20 Fa0/2 10,20 Fa0/3 10,20 Port Vlans in spanning tree forwarding state and not pruned Fa0/1 10,20 Fa0/2 10,20 Fa0/3 10,20 Core的信息，大概这样：0x23 配置单臂路由R0配置如下：Router>en Router#conf t Router(config)#hostname R0 R0(config-if)#int f0/0.10 # 设置为VLAN10的子接口 R0(config-subif)#encapsulation dot1Q 10 R0(config-subif)#ip address 192.168.1.1 255.255.255.0 R0(config-subif)#no shut R0(config-subif)#int f0/0.20 # 设置为VLAN20的子接口 R0(config-subif)#encapsulation dot1Q 20 R0(config-subif)#ip addr 192.168.2.1 255.255.255.0 R0(config-subif)#no shut #打开fa0/0 R0(config-subif)#int fa0/0 R0(config-if)#no shut R0(config-if)#do show ip int brief0x24 S1作为vlan10的STP的根桥，S2作为VLAN20的STP根桥0x240 配置S1S1(config)#spanning-tree vlan 10 priority 0S2S2(config)#spanning-tree vlan 20 priority 00x241 检验S1(config)#do show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.C75A.4A91 Cost 19 Port 1(FastEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 00D0.BA7B.BE88 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/1 Root FWD 19 128.1 P2p Fa0/2 Altn BLK 19 128.2 P2p VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 10 Address 00D0.BA7B.BE88 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 10 (priority 0 sys-id-ext 10) Address 00D0.BA7B.BE88 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/1 Desg FWD 19 128.1 P2p Fa0/2 Desg FWD 19 128.2 P2p Fa0/3 Desg FWD 19 128.3 P2p VLAN0020 Spanning tree enabled protocol ieee Root ID Priority 20 Address 000A.F39C.A203 Cost 19 Port 2(FastEthernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32788 (priority 32768 sys-id-ext 20) Address 00D0.BA7B.BE88 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/1 Desg FWD 19 128.1 P2p Fa0/2 Root FWD 19 128.2 P2p S2(config)#do show spanning-tree VLAN0001 Spanning tree enabled protocol ieee Root ID Priority 32769 Address 0001.C75A.4A91 Cost 19 Port 1(FastEthernet0/1) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32769 (priority 32768 sys-id-ext 1) Address 000A.F39C.A203 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/3 Desg FWD 19 128.3 P2p Fa0/2 Desg FWD 19 128.2 P2p Fa0/1 Root FWD 19 128.1 P2p VLAN0010 Spanning tree enabled protocol ieee Root ID Priority 10 Address 00D0.BA7B.BE88 Cost 19 Port 2(FastEthernet0/2) Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 32778 (priority 32768 sys-id-ext 10) Address 000A.F39C.A203 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/2 Root FWD 19 128.2 P2p Fa0/1 Desg FWD 19 128.1 P2p VLAN0020 Spanning tree enabled protocol ieee Root ID Priority 20 Address 000A.F39C.A203 This bridge is the root Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Bridge ID Priority 20 (priority 0 sys-id-ext 20) Address 000A.F39C.A203 Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec Aging Time 20 Interface Role Sts Cost Prio.Nbr Type ---------------- ---- --- --------- -------- -------------------------------- Fa0/2 Desg FWD 19 128.2 P2p Fa0/1 Desg FWD 19 128.1 P2p S2(config)# 0x25 检验ping一下，通啦0x30 路由部分路由部分：6、互联网区使用OSPF协议。R1／2／3作为area0区，R2／3／4作为Area1区，R3／5作为Area2区7、RO和R6作为企业边界设备，为了上网需要配置默认路由。0x31 配置路由IPR0(10.1.1.254) -> R1(10.1.1.1)R1:12.1.1.1 ->R2(12.1.1.2)R1:13.1.1.1 -> R3(13.1.1.3)R2:24.1.1.2-> R4(24.1.1.4)具体滴就不叙述啦R4的最后一位IP都是4R5的最后一位IP都是5R5的最后一位IP都是6这样配容易找到路由器，也不容易乱。R0：R0#conf t Enter configuration commands, one per line. End with CNTL/Z. R0(config)#int f0/1 R0(config-if)#ip addr 10.1.1.254 255.255.255.0 R0(config-if)#no shut R0(config-if)#do write Building configuration... [OK] R0(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 unassigned YES unset up up FastEthernet0/0.10 192.168.1.1 YES manual up up FastEthernet0/0.20 192.168.2.1 YES manual up up FastEthernet0/1 10.1.1.254 YES manual up up Vlan1 unassigned YES unset administratively down down R0(config-if)#R1:Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R1 R1(config)#int e0/3/0 R1(config-if)#ip addr 10.1.1.1 255.255.255.0 R1(config-if)#no shut R1(config-if)#do write # R1(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 unassigned YES unset administratively down down FastEthernet0/1 unassigned YES unset administratively down down Ethernet0/3/0 10.1.1.1 YES manual up up Vlan1 unassigned YES unset administratively down down # R1(config-if)#int f0/1 R1(config-if)#ip addr 12.1.1.1 255.255.255.0 R1(config-if)#no shut # R1(config-if)#int f0/0 R1(config-if)#ip addr 13.1.1.1 255.255.255.0 R1(config-if)#no shut %LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up R1(config-if)#do write R1(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 13.1.1.1 YES manual up down FastEthernet0/1 12.1.1.1 YES manual up down Ethernet0/3/0 10.1.1.1 YES manual up up Vlan1 unassigned YES unset administratively down downR2：Router>en Router#conf t [Enter configuration commands, one per line. End with CNTL/Z.] Router(config)#hostname R2 R2(config)#int f0/0 R2(config-if)#ip addr 12.1.1.2 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)#int f0/1 R2(config-if)#ip addr 24.1.1.2 255.255.255.0 R2(config-if)#no shut # R2(config-if)#do write Building configuration... [OK] R2(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 12.1.1.2 YES manual up up FastEthernet0/1 24.1.1.2 YES manual up down Vlan1 unassigned YES unset administratively down down R2(config-if)#R3:Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R3 R3(config)#int f0/0 R3(config-if)#ip addr 13.1.1.3 255.255.255.0 R3(config-if)#no shut R3(config-if)#int f0/1 R3(config-if)#ip addr 34.1.1.3 255.255.255.0 R3(config-if)#no shut R3(config-if)#do write R3(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 13.1.1.3 YES manual up up FastEthernet0/1 34.1.1.3 YES manual up down Ethernet0/3/0 unassigned YES unset administratively down down Vlan1 unassigned YES unset administratively down down R4:Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int f0/0 Router(config-if)#ip addr 24.1.1.4 255.255.255.0 Router(config-if)#no shut Router(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 Router(config-if)#hostname R4 R4(config)#int f0/1 R4(config-if)#ip addr 34.1.1.4 255.255.255.0 R4(config-if)#no shut R4(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 R4(config-if)#do write Building configuration... [OK] R4(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 24.1.1.4 YES manual up up FastEthernet0/1 34.1.1.4 YES manual up up Ethernet0/3/0 unassigned YES unset administratively down down Vlan1 unassigned YES unset administratively down down R3-补充R3(config-if)#int e0/3/0 R3(config-if)#ip addr 35.1.1.4 255.255.255.0 R3(config-if)#no shut R3(config-if)#do write Building configuration... [OK] R3(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 13.1.1.3 YES manual up up FastEthernet0/1 34.1.1.3 YES manual up up Ethernet0/3/0 35.1.1.4 YES manual up down Vlan1 unassigned YES unset administratively down down R5Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#int f0/0 Router(config-if)#ip addr 35.1.1.5 255.255.255.0 Router(config-if)#no shut Router(config-if)#hostname R5 R5(config)#int f0/1 R5(config-if)#ip addr 200.1.1.1 255.255.255.0 R5(config-if)#no shut R5(config-if)#do write Building configuration... [OK] R5(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 35.1.1.5 YES manual up up FastEthernet0/1 200.1.1.1 YES manual up up Vlan1 unassigned YES unset administratively down down R5(config-if)#R4 补充R4(config-if)#int e0/3/0 R4(config-if)#ip addr 100.1.1.4 255.255.255.0 R4(config-if)#no shut R4(config-if)#do write Building configuration... [OK] R4(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 24.1.1.4 YES manual up up FastEthernet0/1 34.1.1.4 YES manual up up Ethernet0/3/0 100.1.1.4 YES manual up down Vlan1 unassigned YES unset administratively down down R4(config-if)#R6Router>en Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#hostname R6 R6(config)#int f0/0 R6(config-if)#ip addr 100.1.1.6 255.255.255.0 R6(config-if)#no shut R6(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] R6(config-if)#int fa0/1 R6(config-if)#ip addr 172.16.1.1 255.255.255.0 R6(config-if)#no shut R6(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] R6(config-if)#do show ip int brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 100.1.1.6 YES manual up up FastEthernet0/1 172.16.1.1 YES manual up up Vlan1 unassigned YES unset administratively down down R6(config-if)#do write Building configuration... [OK] R6(config-if)#0x32 配置OSPF在OSPF中，掩码部分是指示网络部分的位，而不是主机部分。因此，使用0.0.0.255而不是255.255.255.0来表示网络命令的掩码。在R1, R2, R3上配置Area 0R1(config)#router ospf 1 R1(config-router)#network 10.1.1.0 0.0.0.255 area 0 R1(config-router)#network 12.1.1.0 0.0.0.255 area 0 R1(config-router)#network 13.1.1.0 0.0.0.255 area 0 R2(config)#router ospf 1 R2(config-router)#network 12.1.1.0 0.0.0.255 area 0 R2(config-router)#network 24.1.1.0 0.0.0.255 area 1 R3(config)#router ospf 1 R3(config-router)#network 13.1.1.0 0.0.0.255 area 0 R3(config-router)#network 34.1.1.0 0.0.0.255 area 1 R3(config-router)#network 35.1.1.0 0.0.0.255 area 2在R2, R3, R4上配置Area 1R4(config)#router ospf 1 R4(config-router)#network 24.1.1.0 0.0.0.255 area 1 R4(config-router)#network 34.1.1.0 0.0.0.255 area 1 R4(config-router)#network 100.1.1.0 0.0.0.255 area 1在R3, R5上配置Area 2这里注意一下，Area 2 应该是stub，但是咱们的题目要求中没有说，开始配置的时候没有配置为stub模式，修改的章节在0x48，在network 35.1.1.0 0.0.0.255 area 2之后，用R5 R3 (config)#area 2 stub即可，详细见0x48章节，同时，如果现在配置stub的话（是正确的），本章节中，后续的ospf database 中可能会有一小点偏差。R5(config)#router ospf 1 R5(config-router)#network 35.1.1.0 0.0.0.255 area 2 R5(config-router)#network 200.1.1.0 0.0.0.255 area 2在R4, R6上配置Area 1和Area 3R6(config)#router ospf 1 R6(config-router)#network 100.1.1.0 0.0.0.255 area 3 R6(config-router)#network 172.16.1.0 0.0.0.255 area 3为R0和R6配置默认路由R0(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.1 R6(config)#ip route 0.0.0.0 0.0.0.0 100.1.1.40x33 检验OSPFR1(config)#do 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 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 route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Ethernet0/3/0 12.0.0.0/24 is subnetted, 1 subnets C 12.1.1.0 is directly connected, FastEthernet0/1 13.0.0.0/24 is subnetted, 1 subnets C 13.1.1.0 is directly connected, FastEthernet0/0 24.0.0.0/24 is subnetted, 1 subnets O IA 24.1.1.0 [110/2] via 12.1.1.2, 00:07:29, FastEthernet0/1 34.0.0.0/24 is subnetted, 1 subnets O IA 34.1.1.0 [110/2] via 13.1.1.3, 00:06:53, FastEthernet0/0 35.0.0.0/24 is subnetted, 1 subnets O IA 35.1.1.0 [110/11] via 13.1.1.3, 00:06:53, FastEthernet0/0 100.0.0.0/24 is subnetted, 1 subnets O IA 100.1.1.0 [110/12] via 12.1.1.2, 00:05:23, FastEthernet0/1 [110/12] via 13.1.1.3, 00:05:23, FastEthernet0/0 O IA 200.1.1.0/24 [110/12] via 13.1.1.3, 00:04:09, FastEthernet0/0 R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#do 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 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 route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 1 subnets O 10.1.1.0 [110/11] via 12.1.1.1, 00:19:12, FastEthernet0/0 12.0.0.0/24 is subnetted, 1 subnets C 12.1.1.0 is directly connected, FastEthernet0/0 13.0.0.0/24 is subnetted, 1 subnets O 13.1.1.0 [110/2] via 12.1.1.1, 00:19:12, FastEthernet0/0 24.0.0.0/24 is subnetted, 1 subnets C 24.1.1.0 is directly connected, FastEthernet0/1 34.0.0.0/24 is subnetted, 1 subnets O 34.1.1.0 [110/2] via 24.1.1.4, 00:16:53, FastEthernet0/1 35.0.0.0/24 is subnetted, 1 subnets O IA 35.1.1.0 [110/12] via 12.1.1.1, 00:18:13, FastEthernet0/0 100.0.0.0/24 is subnetted, 1 subnets O 100.1.1.0 [110/11] via 24.1.1.4, 00:16:53, FastEthernet0/1 O IA 200.1.1.0/24 [110/13] via 12.1.1.1, 00:15:34, FastEthernet0/0 R3#conf t Enter configuration commands, one per line. End with CNTL/Z. R3(config)#do 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 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 route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 1 subnets O 10.1.1.0 [110/11] via 13.1.1.1, 00:18:41, FastEthernet0/0 12.0.0.0/24 is subnetted, 1 subnets O 12.1.1.0 [110/2] via 13.1.1.1, 00:18:41, FastEthernet0/0 13.0.0.0/24 is subnetted, 1 subnets C 13.1.1.0 is directly connected, FastEthernet0/0 24.0.0.0/24 is subnetted, 1 subnets O 24.1.1.0 [110/2] via 34.1.1.4, 00:17:16, FastEthernet0/1 34.0.0.0/24 is subnetted, 1 subnets C 34.1.1.0 is directly connected, FastEthernet0/1 35.0.0.0/24 is subnetted, 1 subnets C 35.1.1.0 is directly connected, Ethernet0/3/0 100.0.0.0/24 is subnetted, 1 subnets O 100.1.1.0 [110/11] via 34.1.1.4, 00:17:16, FastEthernet0/1 O 200.1.1.0/24 [110/11] via 35.1.1.5, 00:16:02, Ethernet0/3/0 R4#conf t Enter configuration commands, one per line. End with CNTL/Z. R4(config)#do 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 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 route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 1 subnets O IA 10.1.1.0 [110/12] via 24.1.1.2, 00:17:38, FastEthernet0/0 [110/12] via 34.1.1.3, 00:17:28, FastEthernet0/1 12.0.0.0/24 is subnetted, 1 subnets O IA 12.1.1.0 [110/2] via 24.1.1.2, 00:17:38, FastEthernet0/0 13.0.0.0/24 is subnetted, 1 subnets O IA 13.1.1.0 [110/2] via 34.1.1.3, 00:17:28, FastEthernet0/1 24.0.0.0/24 is subnetted, 1 subnets C 24.1.1.0 is directly connected, FastEthernet0/0 34.0.0.0/24 is subnetted, 1 subnets C 34.1.1.0 is directly connected, FastEthernet0/1 35.0.0.0/24 is subnetted, 1 subnets O IA 35.1.1.0 [110/11] via 34.1.1.3, 00:17:28, FastEthernet0/1 100.0.0.0/24 is subnetted, 1 subnets C 100.1.1.0 is directly connected, Ethernet0/3/0 O IA 200.1.1.0/24 [110/12] via 34.1.1.3, 00:16:14, FastEthernet0/1 R5(config)#do 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 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 route Gateway of last resort is not set 10.0.0.0/24 is subnetted, 1 subnets O IA 10.1.1.0 [110/12] via 35.1.1.4, 00:14:33, FastEthernet0/0 12.0.0.0/24 is subnetted, 1 subnets O IA 12.1.1.0 [110/3] via 35.1.1.4, 00:14:33, FastEthernet0/0 13.0.0.0/24 is subnetted, 1 subnets O IA 13.1.1.0 [110/2] via 35.1.1.4, 00:14:33, FastEthernet0/0 24.0.0.0/24 is subnetted, 1 subnets O IA 24.1.1.0 [110/3] via 35.1.1.4, 00:14:33, FastEthernet0/0 34.0.0.0/24 is subnetted, 1 subnets O IA 34.1.1.0 [110/2] via 35.1.1.4, 00:14:33, FastEthernet0/0 35.0.0.0/24 is subnetted, 1 subnets C 35.1.1.0 is directly connected, FastEthernet0/0 100.0.0.0/24 is subnetted, 1 subnets O IA 100.1.1.0 [110/12] via 35.1.1.4, 00:14:33, FastEthernet0/0 C 200.1.1.0/24 is directly connected, FastEthernet0/1 IA 是什么意思： IA = inner area看下配置：R1#show ip ospf databaseR1:R1(config)#do show ip ospf database OSPF Router with ID (13.1.1.1) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 13.1.1.1 13.1.1.1 311 0x80000006 0x005368 3 24.1.1.2 24.1.1.2 347 0x80000004 0x00ba3f 1 35.1.1.4 35.1.1.4 309 0x80000004 0x00c616 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 12.1.1.1 13.1.1.1 365 0x80000003 0x008c53 13.1.1.1 13.1.1.1 311 0x80000004 0x00dfbd Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 24.1.1.0 24.1.1.2 342 0x80000004 0x0049db 34.1.1.0 35.1.1.4 305 0x80000006 0x0053b8 35.1.1.0 35.1.1.4 305 0x80000007 0x009e62 34.1.1.0 24.1.1.2 227 0x80000005 0x00ce4a 100.1.1.0 24.1.1.2 217 0x80000006 0x00c903 24.1.1.0 35.1.1.4 216 0x80000008 0x00db37 100.1.1.0 35.1.1.4 216 0x80000009 0x005468 200.1.1.0 35.1.1.4 143 0x8000000a 0x00391eR2:R2(config)#do show ip ospf database OSPF Router with ID (24.1.1.2) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 24.1.1.2 24.1.1.2 442 0x80000004 0x00ba3f 1 13.1.1.1 13.1.1.1 407 0x80000006 0x005368 3 35.1.1.4 35.1.1.4 405 0x80000004 0x00c616 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 12.1.1.1 13.1.1.1 461 0x80000003 0x008c53 13.1.1.1 13.1.1.1 407 0x80000004 0x00dfbd Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 24.1.1.0 24.1.1.2 437 0x80000004 0x0049db 34.1.1.0 24.1.1.2 322 0x80000005 0x00ce4a 100.1.1.0 24.1.1.2 312 0x80000006 0x00c903 34.1.1.0 35.1.1.4 401 0x80000006 0x0053b8 35.1.1.0 35.1.1.4 401 0x80000007 0x009e62 24.1.1.0 35.1.1.4 312 0x80000008 0x00db37 100.1.1.0 35.1.1.4 312 0x80000009 0x005468 200.1.1.0 35.1.1.4 237 0x8000000a 0x00391e Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 24.1.1.2 24.1.1.2 327 0x80000003 0x009e43 1 35.1.1.4 35.1.1.4 319 0x80000003 0x005859 1 100.1.1.4 100.1.1.4 317 0x80000006 0x00b6aa 3 Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 24.1.1.2 24.1.1.2 327 0x80000002 0x003204 34.1.1.3 35.1.1.4 319 0x80000002 0x0015db Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 12.1.1.0 24.1.1.2 437 0x80000007 0x00df4e 10.1.1.0 24.1.1.2 437 0x80000008 0x005cc8 13.1.1.0 24.1.1.2 437 0x80000009 0x00d851 35.1.1.0 24.1.1.2 391 0x8000000a 0x001cec 200.1.1.0 24.1.1.2 233 0x8000000b 0x00baa6 35.1.1.0 35.1.1.4 404 0x80000007 0x009e62 13.1.1.0 35.1.1.4 399 0x80000008 0x0061bd 12.1.1.0 35.1.1.4 399 0x80000009 0x0076a7 10.1.1.0 35.1.1.4 399 0x8000000a 0x00e82dR3:R3(config)#do show ip ospf database OSPF Router with ID (35.1.1.4) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 24.1.1.2 24.1.1.2 1420 0x80000003 0x00bc3e 1 35.1.1.4 35.1.1.4 1383 0x80000003 0x00c815 1 13.1.1.1 13.1.1.1 1383 0x80000005 0x005567 3 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 12.1.1.1 13.1.1.1 1437 0x80000001 0x0032ff 13.1.1.1 13.1.1.1 1383 0x80000002 0x005cc5 Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 24.1.1.0 24.1.1.2 1415 0x80000001 0x004fd8 34.1.1.0 35.1.1.4 1379 0x80000001 0x005db3 35.1.1.0 35.1.1.4 1379 0x80000002 0x00a85d 34.1.1.0 24.1.1.2 1300 0x80000002 0x00d447 100.1.1.0 24.1.1.2 1290 0x80000003 0x00cfff 24.1.1.0 35.1.1.4 1290 0x80000003 0x00e532 100.1.1.0 35.1.1.4 1290 0x80000004 0x005e63 200.1.1.0 35.1.1.4 1216 0x80000005 0x004319 Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 24.1.1.2 24.1.1.2 1306 0x80000002 0x00a042 1 35.1.1.4 35.1.1.4 1295 0x80000002 0x005a58 1 100.1.1.4 100.1.1.4 1295 0x80000005 0x00b8a9 3 Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 24.1.1.2 24.1.1.2 1306 0x80000001 0x0072be 34.1.1.3 35.1.1.4 1295 0x80000001 0x00e328 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 35.1.1.0 35.1.1.4 1380 0x80000001 0x00aa5c 13.1.1.0 35.1.1.4 1375 0x80000002 0x006db7 12.1.1.0 35.1.1.4 1375 0x80000003 0x0082a1 10.1.1.0 35.1.1.4 1375 0x80000004 0x00f427 12.1.1.0 24.1.1.2 1416 0x80000001 0x00eb48 10.1.1.0 24.1.1.2 1416 0x80000002 0x0068c2 13.1.1.0 24.1.1.2 1416 0x80000003 0x00e44b 35.1.1.0 24.1.1.2 1370 0x80000005 0x0026e7 200.1.1.0 35.1.1.4 1216 0x80000006 0x00411a 200.1.1.0 24.1.1.2 1211 0x80000006 0x00c4a1 Router Link States (Area 2) Link ID ADV Router Age Seq# Checksum Link count 35.1.1.4 35.1.1.4 1221 0x80000002 0x00277e 1 200.1.1.1 200.1.1.1 1221 0x80000003 0x001f6d 2 Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 35.1.1.4 35.1.1.4 1221 0x80000001 0x007528 Summary Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 34.1.1.0 35.1.1.4 1379 0x80000001 0x005db3 13.1.1.0 35.1.1.4 1374 0x80000002 0x006db7 12.1.1.0 35.1.1.4 1374 0x80000003 0x0082a1 10.1.1.0 35.1.1.4 1374 0x80000004 0x00f427 24.1.1.0 35.1.1.4 1290 0x80000006 0x00df35 100.1.1.0 35.1.1.4 1290 0x80000007 0x005866R4:R4(config)#do show ip ospf database OSPF Router with ID (100.1.1.4) (Process ID 1) Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 100.1.1.4 100.1.1.4 292 0x80000006 0x00b6aa 3 24.1.1.2 24.1.1.2 303 0x80000003 0x009e43 1 35.1.1.4 35.1.1.4 294 0x80000003 0x005859 1 Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 24.1.1.2 24.1.1.2 303 0x80000002 0x003204 34.1.1.3 35.1.1.4 294 0x80000002 0x0015db Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 12.1.1.0 24.1.1.2 412 0x80000007 0x00df4e 10.1.1.0 24.1.1.2 412 0x80000008 0x005cc8 13.1.1.0 24.1.1.2 412 0x80000009 0x00d851 35.1.1.0 35.1.1.4 379 0x80000007 0x009e62 13.1.1.0 35.1.1.4 374 0x80000008 0x0061bd 12.1.1.0 35.1.1.4 374 0x80000009 0x0076a7 10.1.1.0 35.1.1.4 374 0x8000000a 0x00e82d 35.1.1.0 24.1.1.2 366 0x8000000a 0x001cec 200.1.1.0 35.1.1.4 215 0x8000000b 0x00371f 200.1.1.0 24.1.1.2 209 0x8000000b 0x00baa6R5：R5#conf t Enter configuration commands, one per line. End with CNTL/Z. R5(config)#do show ip ospf database OSPF Router with ID (200.1.1.1) (Process ID 1) Router Link States (Area 2) Link ID ADV Router Age Seq# Checksum Link count 200.1.1.1 200.1.1.1 229 0x80000004 0x001d6e 2 35.1.1.4 35.1.1.4 229 0x80000003 0x00257f 1 Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 35.1.1.4 35.1.1.4 229 0x80000002 0x007040 Summary Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 34.1.1.0 35.1.1.4 387 0x80000008 0x004fba 13.1.1.0 35.1.1.4 382 0x80000009 0x005fbe 12.1.1.0 35.1.1.4 382 0x8000000a 0x0074a8 10.1.1.0 35.1.1.4 382 0x8000000b 0x00e62e 24.1.1.0 35.1.1.4 298 0x8000000c 0x00d33b 100.1.1.0 35.1.1.4 298 0x8000000d 0x004c6cADV Router列表示该链路状态信息的广播路由器的IDAge列表示从上次收到该链路状态信息以来的时间（以秒为单位）Seq#列表示链路状态信息的序列号，用于唯一标识该信息的版本Link count列表示该链路状态条目中的链路数量0x34 尝试pingpingR0#ping 100.1.1.6 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 100.1.1.6, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/11/25 ms在R0上pingR0>ping % Incomplete command. R0>ping 200.1.1.233 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 200.1.1.233, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/2/9 msR5进行PINGR6 tracerouterR6#traceroute 10.1.1.254 Type escape sequence to abort. Tracing the route to 10.1.1.254 1 100.1.1.4 0 msec 0 msec 9 msec 2 34.1.1.3 6 msec 0 msec 7 msec 3 12.1.1.1 0 msec 1 msec 0 msec 4 10.1.1.254 0 msec 19 msec 0 msec 感觉没什么问题啦0x40 其他部分其它部分：8、公网DNS服务器为分支1提供DNS解析服务。9、分支2的web服务器为分支1提供web访问服务。10、分支一需要配置端口地址转换（PNAT）实现内部主机上网。但是为了避免代码泄露，研发部门不允许上网。11、分之二需要配置端口映射（DNAT），提供对外的web服务。域名www．自己的名字拼音．com。0x41 分支1上网R0划分内网外网R0(config)#int f0/1 R0(config-if)#ip nat outside R0(config-if)#int f0/0.10 R0(config-subif)#ip nat inside R0(config-subif)#int f0/0.20 R0(config-subif)#ip nat inside # 如果需需要的话，删ACL表 R0(config)#no ip access-list standard 1 # 用扩展ACL表 R0(config)#access-list 100 deny ip 192.168.2.0 0.0.0.255 any R0(config)#access-list 100 permit ip 192.168.1.0 0.0.0.255 any R0(config)#do show access-lists Extended IP access list 100 10 deny ip 192.168.2.0 0.0.0.255 any 20 permit ip 192.168.1.0 0.0.0.255 any # 根据ACL表进行NAT R0(config)#ip nat inside source list 100 interface f0/1 overload测试一下：ping 100.1.1.6可以通滴试试PC-1，通不了0x42 分支2 网上冲浪服务器的网上冲浪R6#conf t Enter configuration commands, one per line. End with CNTL/Z. R6(config)#int f0/0 R6(config-if)#ip nat outside R6(config-if)#int f0/1 R6(config-if)#ip nat inside R6(config-if)#exit # 转发端口 R6(config)#ip nat inside source static tcp 172.16.1.233 80 100.1.1.6 80 R6#show ip nat translations Pro Inside global Inside local Outside local Outside global tcp 100.1.1.6:80 172.16.1.233:80 --- --- tcp 100.1.1.6:80 172.16.1.233:80 10.1.1.254:1026 10.1.1.254:1026 tcp 100.1.1.6:80 172.16.1.233:80 10.1.1.254:1027 10.1.1.254:10270x43 测试是否可以网上冲浪用PC0访问http://100.1.1.6页面可以打开！芜湖0x44 （可选）加个index_dayi.html诶嘿！（打开网页巨慢，不加速的话要20秒左右）http://100.1.1.6/index_dayi.html0x45 配置DNS服务器公网DNS服务器为分支1提供DNS解析服务。分之二需要配置端口映射（DNAT），提供对外的web服务。域名www．自己的名字拼音．com。公网DNS服务器为分支1提供DNS解析服务。当前PC-0 是可以直接访问DNS服务器IP的：200.1.1.233于是，只需要配置DNS即可：0x46 测试一下nslookup www.dayi.ink解析成功啦。试一试大体上ok，要下火车了等下写，2023年6月23日09:37:492023年6月23日14:58:31，好困。0x47 配置自己的域名域名www．自己的名字拼音．com。最后加一个这个就可以啦。然后试一试就可以了。0x48 Area2 小修Area 2 的这里是Stub应该进行一下修改。R3(config)#router ospf 1 R3(config-router)#network 13.1.1.0 0.0.0.255 area 0 R3(config-router)#network 34.1.1.0 0.0.0.255 area 1 R3(config-router)#network 35.1.1.0 0.0.0.255 area 2 R3(config-router)#area 2 stub R5(config)#router ospf 1 R5(config-router)#network 35.1.1.0 0.0.0.255 area 2 R5(config-router)#network 200.1.1.0 0.0.0.255 area 2 R5(config-router)#area 2 st R5(config-router)#area 2 stub R5(config-router)#ex然后看下dbR3(config)#do show ip ospf database可以看到Area2 的出口是35.1.1.4（R4）路由器R3(config)#do show ip ospf database OSPF Router with ID (35.1.1.4) (Process ID 1) Router Link States (Area 0) Link ID ADV Router Age Seq# Checksum Link count 35.1.1.4 35.1.1.4 1332 0x80000003 0x00dcfe 1 13.1.1.1 13.1.1.1 1327 0x80000006 0x00b008 3 24.1.1.2 24.1.1.2 1327 0x80000003 0x00c633 1 Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 13.1.1.3 35.1.1.4 1332 0x80000001 0x00620f 12.1.1.2 24.1.1.2 1327 0x80000001 0x00b5d3 Summary Net Link States (Area 0) Link ID ADV Router Age Seq# Checksum 34.1.1.0 35.1.1.4 1327 0x80000001 0x005db3 35.1.1.0 35.1.1.4 1327 0x80000002 0x00a85d 24.1.1.0 24.1.1.2 1322 0x80000001 0x004fd8 34.1.1.0 24.1.1.2 1317 0x80000002 0x00d447 100.1.1.0 24.1.1.2 1317 0x80000003 0x00cfff 24.1.1.0 35.1.1.4 1317 0x80000004 0x00e333 100.1.1.0 35.1.1.4 1317 0x80000005 0x005c64 200.1.1.0 35.1.1.4 79 0x80000006 0x00411a Router Link States (Area 1) Link ID ADV Router Age Seq# Checksum Link count 35.1.1.4 35.1.1.4 1327 0x80000003 0x00624e 1 100.1.1.4 100.1.1.4 1322 0x80000006 0x00e07d 3 24.1.1.2 24.1.1.2 1322 0x80000002 0x00b42c 1 Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 34.1.1.4 100.1.1.4 1327 0x80000001 0x00d9e7 24.1.1.4 100.1.1.4 1327 0x80000002 0x00ff69 Summary Net Link States (Area 1) Link ID ADV Router Age Seq# Checksum 13.1.1.0 35.1.1.4 1327 0x80000001 0x006fb6 35.1.1.0 35.1.1.4 1327 0x80000002 0x00a85d 12.1.1.0 24.1.1.2 1322 0x80000001 0x00eb48 13.1.1.0 24.1.1.2 1322 0x80000002 0x00e64a 10.1.1.0 24.1.1.2 1322 0x80000003 0x0066c3 35.1.1.0 24.1.1.2 1322 0x80000005 0x0026e7 12.1.1.0 35.1.1.4 1312 0x80000004 0x0080a2 10.1.1.0 35.1.1.4 1312 0x80000005 0x00f228 200.1.1.0 35.1.1.4 79 0x80000006 0x00411a 200.1.1.0 24.1.1.2 74 0x80000007 0x00c2a2 Router Link States (Area 2) Link ID ADV Router Age Seq# Checksum Link count 35.1.1.4 35.1.1.4 84 0x80000004 0x002d75 1 200.1.1.1 200.1.1.1 84 0x80000006 0x002365 2 Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 35.1.1.5 200.1.1.1 1332 0x80000001 0x0047ae Summary Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 13.1.1.0 35.1.1.4 1327 0x80000001 0x006fb6 34.1.1.0 35.1.1.4 1327 0x80000002 0x005bb4 24.1.1.0 35.1.1.4 1317 0x80000003 0x00e532 100.1.1.0 35.1.1.4 1317 0x80000004 0x005e63 12.1.1.0 35.1.1.4 1312 0x80000005 0x007ea3 10.1.1.0 35.1.1.4 1312 0x80000006 0x00f029 0.0.0.0 35.1.1.4 346 0x80000007 0x00240b R5#show ip ospf database OSPF Router with ID (200.1.1.1) (Process ID 1) Router Link States (Area 2) Link ID ADV Router Age Seq# Checksum Link count 35.1.1.4 35.1.1.4 1372 0x80000004 0x002d75 1 200.1.1.1 200.1.1.1 1372 0x80000006 0x002365 2 Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 35.1.1.5 200.1.1.1 818 0x80000002 0x007b0e Summary Net Link States (Area 2) Link ID ADV Router Age Seq# Checksum 0.0.0.0 35.1.1.4 1634 0x80000007 0x00240b 13.1.1.0 35.1.1.4 814 0x80000008 0x0061bd 34.1.1.0 35.1.1.4 814 0x80000009 0x004dbb 24.1.1.0 35.1.1.4 804 0x8000000a 0x00d739 100.1.1.0 35.1.1.4 804 0x8000000b 0x00506a 12.1.1.0 35.1.1.4 799 0x8000000c 0x0070aa 10.1.1.0 35.1.1.4 799 0x8000000d 0x00e230 R5#重新尝试ping一下服务器，是可以通的。PC-0 ping PC-1也是可以滴重新打开网页试一试,正常打开。0x49 保存所有的配置文件S1#copy running-config startup-config S2#copy running-config startup-config Core#copy running-config startup-config R0#copy running-config startup-config R1#copy running-config startup-config R2#copy running-config startup-config R3#copy running-config startup-config R4#copy running-config startup-config R5#copy running-config startup-config R6#copy running-config startup-config 0xFF 文件下载0x10 -> 0x31.7：https://p.dabbit.net/blog/pic_bed/0x10-0x37.7_%E7%BB%BC%E5%90%88%E5%AE%9E%E9%AA%8C_94bf0dbc-2785-4e62-ad54-61568fa70.zip0x10 -> 0x44 https://p.dabbit.net/blog/pic_bed/0x10-0x44_%E7%BB%BC%E5%90%88%E5%AE%9E%E9%AA%8C_70c0d130-911a-49ed-b447-46351011fd18.zip0x10->0x49:https://p.dabbit.net/blog/pic_bed/0x10-0x49_%E7%BB%BC%E5%90%88%E5%AE%9E%E9%AA%8C_73af134e-7b5d-4a3f.zip
路由交换-作业12 15.6.2lab当前进度 1.00更新地址: https://blog.dayi.ink/?p=52更新地址: https://type.dayiyi.top/index.php/archives/182/【dayi的大键盘】新的博客：https://blog.dayi.ink ，欢迎来体验新的阅读。更新中修改的内容本文考虑写作时间的特殊性，如有问题请直接在文章末尾留言，相互提醒下，可能不再更新（写到凌晨1点多，明天还有特别多特别多事，估计来不及改了0x00 准备文件word文件oppos，要自己画）步骤文件可以去末尾下0x01 打开文件没有这个步骤0x02 准备文件4321 * 22960 * 2记得注意接口。0x10 第 *1* 部分： 建立网络并配置设备的基本设置0x11 步骤 1 ： 建立如拓扑图所示的网络。如上图所示0x12 步骤 *2* ： 为每台路由器配置基本设置。a. 为路由器分配一个设备名称。打开配置窗口b. 要防止路由器尝试将错误输入的命令视为主机名， 则禁用 DNS 查找。c. 指定 *class* 作为特权 EXEC 加密密码。d. 指定 *cisco* 作为控制台密码并启用登录。e. 指定 *cisco* 作为 VTY 密码并启用登录。f. 加密明文密码。g. 创建一个向访问设备者发出警告的标语：未经授权，禁止访问。h. 将运行配置保存到启动配置文件中。R1no Router>en Router#conf t Router(config)#hostname R1 R1(config)#no ip domain lookup R1(config)#enable secret class R1(config)#line console 0 R1(config-line)#password cisco R1(config-line)#login R1(config-line)#line vty 0 4 R1(config-line)#password cisco R1(config-line)#login R1(config-line)#service password-encryption R1(config)#banner motd $ Authorized Users Only! $ R1(config)#exit R1#copy running-config startup-config R2Router>en Router#conf t Router(config)#hostname R2 R2(config)#no ip domain lookup R2(config)#enable secret class R2(config)#line console 0 R2(config-line)#password cisco R2(config-line)#login R2(config-line)#line vty 0 4 R2(config-line)#password cisco R2(config-line)#login R2(config-line)#service password-encryption R2(config)#banner motd $ Authorized Users Only! $ R2(config)#exit R2# %SYS-5-CONFIG_I: Configured from console by console copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] R2#0x13 步骤 *3* ： 配置每台交换机的基本设置。a. 给交换机分配一个设备名称。b. 要防止路由器尝试将错误输入的命令视为主机名， 则禁用 DNS 查找。c. 指定 *class* 作为特权 EXEC 加密密码。d. 指定 *cisco* 作为控制台密码并启用登录。e. 指定 *cisco* 作为 VTY 密码并启用登录。f. 加密明文密码。g. 创建一个向访问设备者发出警告的标语：未经授权，禁止访问。h. 关闭所有不使用的接口。i. 将运行配置保存到启动配置文件中。 问题：S1Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname S1 S1(config)#no ip domain-lookup S1(config)#enable secret class S1(config)#line console 0 S1(config-line)#password cisco S1(config-line)#login S1(config-line)#line vty 0 15 S1(config-line)#password cisco S1(config-line)#login S1(config-line)#service password-encryption S1(config)#banner motd $ Authorized Users Only! $ S1(config)#interface range f0/1-3, f0/6-24, g0/1-2 S1(config-if-range)#shut S1(config-if-range)#exit S1(config)#end S1#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] S1#S2Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#hostname S2 S2(config)#no ip domain-lookup S2(config)#enable secret class S2(config)#line console 0 S2(config-line)#password cisco S2(config-line)#login S2(config-line)#line vty 0 15 S2(config-line)#password cisco S2(config-line)#login S2(config-line)#service password-encryption S2(config)#banner motd $ Authorized Users Only! $ S2(config)#interface range f0/1-3, f0/6-24, g0/1-2 S2(config-if-range)#shut S2(config-if-range)#end S2# S2#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK] S2#Q.0x13.i 这时在 R1 或 R2 上输入命令 show cdp neighbors 会看到一个空的列表。说明原因。R1#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone Device ID Local Intrfce Holdtme Capability Platform Port ID R1# R2#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone Device ID Local Intrfce Holdtme Capability Platform Port ID R2# S2#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone Device ID Local Intrfce Holdtme Capability Platform Port ID S1 Fas 0/4 165 S 2960 Fas 0/4 S2# S1#show cdp neighbors Capability Codes: R - Router, T - Trans Bridge, B - Source Route Bridge S - Switch, H - Host, I - IGMP, r - Repeater, P - Phone Device ID Local Intrfce Holdtme Capability Platform Port ID Switch Fas 0/4 17 S 2960 Fas 0/4 S2 Fas 0/4 137 S 2960 Fas 0/4 S1#R1 R2之间是空列表，因为链路是关闭的。所以没有相邻的相关邻居。0x20 第 2 部分： 在 R1 和 R2 上配置并验证 IPv4 和 IPv6 地址在第 2 部分中，您需要在 R1 和 R2 上配置并验证 IPv4 和 IPv6 地址。使用上表中包含的必要信息来完成这部 分的任务0x21 步骤 1 ： 给两台路由器配置 IP 地址。a. 在两台路由器上启用 IPv6 单播路由。b. 根据地址分配表给所有接口配置 IP 地址。R1: R1(config)#ipv6 unicast-routing R1(config)#int g0/0/0 R1(config-if)#ip addr 172.16.1.1 255.255.255.0 R1(config-if)#ipv6 addr fe80::1 link-local R1(config-if)#ipv6 addr 2001:db8:acad:2::1/64 R1(config-if)#no shut R1(config)#int g0/0/1 R1(config-if)#ip addr 192.168.1.1 255.255.255.0 R1(config-if)#ipv6 addr fe80::1 link-local R1(config-if)#ipv6 addr 2001:db8:acad:1::1/64 R1(config-if)#no shut R1(config-if)#int lo1 R1(config-if)#ip addr 10.1.0.1 255.255.255.0 R1(config-if)#ipv6 addr fe80::1 link-local R1(config-if)#ipv6 addr 2001:db8:acad:10::1/64 R1(config-if)#no shut R1(config-if)#int lo2 R1(config-if)#ip addr 209.165.200.225 255.255.255.224 R1(config-if)#ipv6 addr fe80::1 link-local R1(config-if)#ipv6 addr 2001:db8:acad:209::1/64 R1(config-if)#no shut R1(config-if)#endR2:R2#enable R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#ipv6 unicast-routing R2(config)#int g0/0/0 R2(config-if)#ip addr 172.16.1.2 255.255.255.0 R2(config-if)#ipv6 addr fe80::2 link-local R2(config-if)#ipv6 addr 2001:db8:acad:2::2/64 R2(config-if)#no shut R2(config-if)#int g0/0/1 R2(config-if)#ip addr 192.168.1.2 255.255.255.0 R2(config-if)#ipv6 addr fe80::2 link-local R2(config-if)#ipv6 addr 2001:db8:acad:1::2/64 R2(config-if)#no shut R2(config-if)#int lo1 R2(config-if)#ip addr 10.2.0.1 255.255.255.0 R2(config-if)#ipv6 addr fe80::2 link-local R2(config-if)#ipv6 addr 2001:db8:acad:11::2/64 R2(config-if)#no shut R2(config)#int lo2 R2(config-if)#ip addr 209.165.200.193 255.255.255.224 R2(config-if)#ipv6 addr fe80::2 link-local R2(config-if)#ipv6 addr 2001:db8:acad:210::1/64 R2(config-if)#no shut R2(config-if)#end0x22 验证地址：R1:R1#show ip int brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0/0 172.16.1.1 YES manual up up GigabitEthernet0/0/1 192.168.1.1 YES manual up up Loopback1 10.1.0.1 YES manual up up Loopback2 209.165.200.225 YES manual up up Vlan1 unassigned YES unset administratively down down R1# R1#show ipv6 int brief GigabitEthernet0/0/0 [up/up] FE80::1 2001:DB8:ACAD:2::1 GigabitEthernet0/0/1 [up/up] FE80::1 2001:DB8:ACAD:1::1 Loopback1 [up/up] FE80::1 2001:DB8:ACAD:10::1 Loopback2 [up/up] FE80::1 2001:DB8:ACAD:209::1 Vlan1 [administratively down/down] unassigned R1#R2:R2#show ip int brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0/0 172.16.1.2 YES manual up up GigabitEthernet0/0/1 192.168.1.2 YES manual up up Loopback1 10.2.0.1 YES manual up up Loopback2 209.165.200.193 YES manual up up Vlan1 unassigned YES unset administratively down down R2# R2#show ipv6 int brief GigabitEthernet0/0/0 [up/up] FE80::2 2001:DB8:ACAD:2::2 GigabitEthernet0/0/1 [up/up] FE80::2 2001:DB8:ACAD:1::2 Loopback1 [up/up] FE80::2 2001:DB8:ACAD:11::2 Loopback2 [up/up] FE80::2 2001:DB8:ACAD:210::1 Vlan1 [administratively down/down] unassigned R2#0x23 保存配置文件R1:R1#copy running-config startup-config Destination filename [startup-config]? Building configuration...R2:R2#copy running-config startup-config Destination filename [startup-config]? Building configuration... [OK]0x30 第 3 部分： 在 R1 和 R2 上配置并验证 IPv4 静态路由和默认路由0x31 步骤 1 ： 在 R1 上，使用 R2 G0/0/1 地址作为下一跳，配置一条去往 R2 Loopback1 网络的静态路由。a. 使用 ping 命令来确认 R2 的 G0/0/1 接口是可达的。b. 配置一条通过 R2 G0/0/1 地址到达 R2 Loopback1 网络的静态路由。R1:R1(config)#ip route 10.2.0.0 255.255.255.0 192.168.1.20x32 步骤 2 ： 在 R1 上，配置一条通过 R2 G0/0/0 地址的静态默认路由a. 使用 ping 命令来确认 R2 的 G0/0/0 接口是可达的。b. 配置一条通过 R2 G0/0/0 地址的静态默认路由。R2 G0/0/0端口IP：设备接口IP地址前缀R2G0/0/0172.16.1.2 /24R1(config)#end R1# %SYS-5-CONFIG_I: Configured from console by console R1#ping 172.16.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 0/0/0 ms 【成功ping通】配置默认静态路由：R1(config)# ip route 0.0.0.0 0.0.0.0 172.16.1.20x33 步骤 3 ： 在 R1 上，配置一条通过 R2 G0/0/1 地址的浮动静态默认路由。配置一条通过 R2 G0/0/1 地址的浮动静态默认路由，将其 AD 设置为 80。AD（Administrative Distance）设置为80。Administrative Distance是路由器用于选择最佳路径的度量标准，较低的AD值表示更可靠的路径。R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.1.2 800x34 步骤 4： 在 R2 上，配置一条通过 R1 G0/0/0 地址的静态默认路由a. 使用 ping 命令来确认 R1 的 G0/0/0 接口是可达的。b. 配置一条通过 R1 G0/0/0 地址的静态默认路由。设备接口*IP* 地址*/*前缀R1G0/0/0172.16.1.1 /24密码：cisco enable密码：class R2#ping 172.16.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms R2#conf t R2(config)#ip route 0.0.0.0 0.0.0.0 172.16.1.10x35 步骤 5： 验证这些路由是否正常工作a. 使用 show ip route 命令确认路由器 R1 的路由表中出现了静态和默认路由。b. 在 R1 上，输入命令 traceroute 10.2.0.1 。输出信息应该显示下一跳是 192.168.1.2。c. 在 R1 上，输入命令 traceroute 209.165.200.193 。输出信息应该显示下一跳是 172.16.1.2。d. 在 R1 G0/0/0 上输入 shutdown 命令。e. 演示显示浮动静态路由正在正常工作。首先，输入 show ip route static 命令。您应该看到两条静态路 由。 AD 为 80 的默认静态路由和 AD 为 1 的静态路由(去往 10.2.0.0/24 网络) 。f. 通过输入命令 traceroute 209.165.200.193 来证明浮动静态路由正在正常工作。traceroute 显示下一跳为 192.168.1.2。g. 在 R1 G0/0/0 上输入 no shutdown 命令。#a. R1(config)#end R1#show ip route Codes: L - local, C - connected, S - static, R - RIP, M - 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 route Gateway of last resort is 172.16.1.2 to network 0.0.0.0 10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks C 10.1.0.0/24 is directly connected, Loopback1 L 10.1.0.1/32 is directly connected, Loopback1 S 10.2.0.0/24 [1/0] via 192.168.1.2 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks C 172.16.1.0/24 is directly connected, GigabitEthernet0/0/0 L 172.16.1.1/32 is directly connected, GigabitEthernet0/0/0 192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks C 192.168.1.0/24 is directly connected, GigabitEthernet0/0/1 L 192.168.1.1/32 is directly connected, GigabitEthernet0/0/1 209.165.200.0/24 is variably subnetted, 2 subnets, 2 masks C 209.165.200.224/27 is directly connected, Loopback2 L 209.165.200.225/32 is directly connected, Loopback2 S* 0.0.0.0/0 [1/0] via 172.16.1.2 ======================================== # b. R1#traceroute 10.2.0.1 Type escape sequence to abort. Tracing the route to 10.2.0.1 1 * 0 msec 0 msec R1#traceroute 10.2.0.1 Type escape sequence to abort. Tracing the route to 10.2.0.1 1 192.168.1.2 0 msec 0 msec 0 msec R1# ======================================== #c. R1#traceroute 209.165.200.193 Type escape sequence to abort. Tracing the route to 209.165.200.193 1 172.16.1.2 0 msec 0 msec 0 msec R1# ======================================== #d. 在 R1 G0/0/0 上输入 shutdown 命令。 R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int g0/0/0 R1(config-if)#shut R1(config-if)#end #e. R1#show ip route static 10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks S 10.2.0.0/24 [1/0] via 192.168.1.2 S* 0.0.0.0/0 [80/0] via 192.168.1.2 R1# #f. R1#traceroute 209.165.200.193 Type escape sequence to abort. Tracing the route to 209.165.200.193 1 192.168.1.2 0 msec 0 msec 0 msec R1# #g.在 R1 G0/0/0 上输入 no shutdown 命令。 R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#int g0/0/0 R1(config-if)#no shut R1(config-if)#end0x40 第 4 部分： 在 R1 和 R2 上配置并验证 IPv6 静态路由和默认路由在第 4 部分中，您需要在 R1 和 R2 上配置静态路由和默认路由，让两台路由器之间能够使用 IPv6 建立完整的 连通性。再次强调，这里使用的静态路由代表不了这种网络环境中的最佳实践，只是为了评估您完成所需配置 的能力。0x41 步骤 1 ： 在 R2 上，使用 R1 G0/0/1 地址作为下一跳，配置一条去往 R1 Loopback1 网络的静态路由。打开配置窗口a. 使用 ping 命令来确认 R1 的 G0/0/1 接口是可达的。b. 配置一条通过 R1 G0/0/1 地址到达 R1 Loopback1 网络的静态路由。R2 G0/0/1端口IP：设备接口IP地址前缀R2G0/0/1192.168.1.2 /24R2:R2#ping 192.168.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/2/5 ms R2(config)#ipv6 route 2001:db8:acad:10::/64 2001:db8:acad:1::1 0x42 步骤 2 ： 在 R2 上，配置一条通过 R1 G0/0/0 地址的静态默认路由a. 使用 ping 命令来确认 R1 的 G0/0/0 接口是可达的。b. 配置一条通过 R1 G0/0/0 地址的静态默认路由。设备接口*IP* 地址*/*前缀R1G0/0/0172.16.1.1 /24R1#ping 172.16.1.1 R2#ping 172.16.1.1 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.1, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)# ipv6 route ::/0 2001:db8:acad:2::1 0x43 步骤 3 ： 在 R2 上，配置一条通过 R1 G0/0/1 地址的浮动静态默认路由配置一条通过 R2 G0/0/1 地址的浮动静态默认路由，将其 AD 设置为 80。R2: R2(config)#ipv6 route ::/0 2001:db8:acad:1::1 80 0x44 步骤 4： 在 R1 上，配置一条通过 R1 G0/0/0 地址的静态默认路由a. 使用 ping 命令来确认 R2 的 G0/0/0 接口是可达的。b. 配置一条通过 R2 G0/0/0 地址的静态默认路由。R2 G0/0/0端口IP：设备接口IP地址前缀R2G0/0/0172.16.1.2 /24R1: R1#ping 172.16.1.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/0 ms R1#conf t Enter configuration commands, one per line. End with CNTL/Z. R1(config)#ipv6 route ::/0 2001:db8:acad:2::2 0x45 步骤 5： 验证这条路由正在正常工作a. 使用 show ipv6 route 命令确认路由器 R2 的路由表中出现了静态和默认路由。b. 在 R2 上，输入命令 traceroute 2001:db8:acad:10::1。输出信息应该显示下一跳是 traceroute 2001:db8:acad:1::1。c. 在 R1 上，输入命令 traceroute 2001:db8:acad:209::1。输出信息应该显示下一跳是 2001:db8:acad:2::1。d. 在 R2 G0/0/0 上输入 shutdown 命令。e. 演示显示浮动静态路由正在正常工作。首先，输入 show ipv6 route static 命令。您应该看到两条静态路 由。 AD 为 80 的默认静态路由和 AD 为 1 的静态路由(去往 2001:db8:acad:10::/64 网络)。f. 最后，通过输入命令 traceroute 2001:db8:acad:209::1 来证明浮动静态路由正在正常工作。traceroute 显 示下一跳为 2001:db8:acad:1::1。#a. R2#show ipv6 route IPv6 Routing Table - 11 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route, M - MIPv6 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 D - EIGRP, EX - EIGRP external S ::/0 [1/0] via 2001:DB8:ACAD:2::1 C 2001:DB8:ACAD:1::/64 [0/0] via GigabitEthernet0/0/1, directly connected L 2001:DB8:ACAD:1::2/128 [0/0] via GigabitEthernet0/0/1, receive C 2001:DB8:ACAD:2::/64 [0/0] via GigabitEthernet0/0/0, directly connected L 2001:DB8:ACAD:2::2/128 [0/0] via GigabitEthernet0/0/0, receive S 2001:DB8:ACAD:10::/64 [1/0] via 2001:DB8:ACAD:1::1 C 2001:DB8:ACAD:11::/64 [0/0] via Loopback1, directly connected L 2001:DB8:ACAD:11::2/128 [0/0] via Loopback1, receive C 2001:DB8:ACAD:210::/64 [0/0] via Loopback2, directly connected L 2001:DB8:ACAD:210::1/128 [0/0] via Loopback2, receive L FF00::/8 [0/0] via Null0, receive #b R2#traceroute 2001:db8:acad:10::1 Type escape sequence to abort. Tracing the route to 2001:db8:acad:10::1 1 2001:DB8:ACAD:1::1 0 msec 0 msec 0 msec #c R2#traceroute 2001:db8:acad:209::1 Type escape sequence to abort. Tracing the route to 2001:db8:acad:209::1 1 2001:DB8:ACAD:2::1 0 msec 0 msec 0 msec R2# #d R2#conf t Enter configuration commands, one per line. End with CNTL/Z. R2(config)#int g0/0/0 R2(config-if)#shut R2(config-if)#end #e: R2#show ipv6 route IPv6 Routing Table - 9 entries Codes: C - Connected, L - Local, S - Static, R - RIP, B - BGP U - Per-user Static route, M - MIPv6 I1 - ISIS L1, I2 - ISIS L2, IA - ISIS interarea, IS - ISIS summary ND - ND Default, NDp - ND Prefix, DCE - Destination, NDr - Redirect O - OSPF intra, OI - OSPF inter, OE1 - OSPF ext 1, OE2 - OSPF ext 2 ON1 - OSPF NSSA ext 1, ON2 - OSPF NSSA ext 2 D - EIGRP, EX - EIGRP external S ::/0 [80/0] via 2001:DB8:ACAD:1::1 C 2001:DB8:ACAD:1::/64 [0/0] via GigabitEthernet0/0/1, directly connected L 2001:DB8:ACAD:1::2/128 [0/0] via GigabitEthernet0/0/1, receive S 2001:DB8:ACAD:10::/64 [1/0] via 2001:DB8:ACAD:1::1 C 2001:DB8:ACAD:11::/64 [0/0] via Loopback1, directly connected L 2001:DB8:ACAD:11::2/128 [0/0] via Loopback1, receive C 2001:DB8:ACAD:210::/64 [0/0] via Loopback2, directly connected L 2001:DB8:ACAD:210::1/128 [0/0] via Loopback2, receive L FF00::/8 [0/0] via Null0, receive 其中： S ::/0 [80/0] via 2001:DB8:ACAD:1::1 S 2001:DB8:ACAD:10::/64 [1/0] via 2001:DB8:ACAD:1::1 是静态路由信息 ## f R2#traceroute 2001:db8:acad:209::1 Type escape sequence to abort. Tracing the route to 2001:db8:acad:209::1 1 2001:DB8:ACAD:1::1 0 msec 0 msec 0 msec R2#0x50 文件下载分步骤文件：下载地址：https://p.dabbit.net/blog/pic_bed/2023/06/7eec12871b2df5bb_202306131923224.rar