diff --git "a/42 \351\273\204\351\242\226\347\245\257/20260509 \351\235\231\346\200\201\350\267\257\347\224\261\347\232\204\351\205\215\347\275\256.md" "b/42 \351\273\204\351\242\226\347\245\257/20260509 \351\235\231\346\200\201\350\267\257\347\224\261\347\232\204\351\205\215\347\275\256.md" new file mode 100644 index 0000000000000000000000000000000000000000..abea6e111e4ea89780e31ba3ad53446f752c8cbd --- /dev/null +++ "b/42 \351\273\204\351\242\226\347\245\257/20260509 \351\235\231\346\200\201\350\267\257\347\224\261\347\232\204\351\205\215\347\275\256.md" @@ -0,0 +1,232 @@ +笔记 + +![image-20260507200434593](https://gitee.com/onesheet/picture-warehouse/raw/master/pic/upgit_20260507_1778155474.png) + +- 新建Cisco PT 拓扑图 +- 为各PC设置IP及网关地址,其中网关地址分别为路由器接口的IP地址 +- 接着为Router0和Router1上的以太网接口配置IP地址 +- 在路由器之间的串行接口上配置IP地址,且IP地址必须在同一子网内 +- 在Router0的串口上设置时钟频率(本次实验Router0为DCE类型,如图Router0一端有时钟图标) +- 査看路由器上的直连路由 +- 在Router0和Router1上配置静态路由 +- 查看路由器上的静态路由 +- 验证不同局域网PC之间的相互通信 + +```bash +PC设置 +192.168.1.1 //PC0 +192.168.1.2 //PC1 +//子网掩码和网关 +255.255.255.0 +192.168.1.254 + +``` + +```bash +PC设置 +192.168.2.1 //PC2 +//子网掩码和网关 +255.255.255.0 +192.168.2.254 + +``` + +```bash +Router0 基本配置 +Router>enable +Router#conf t +Router(config)#inter f0/0 //进入第0模块第0端口(快速以太网接口) +Router(config-if)#ip address 192.168.1.254 255.255.255.0 //配置f0/0接口IP +Router(config-if)#no shutdown //开启端口 +Router(config-if)#exit +Router(config)#interface serial 2/0 //进入第2模块第0端口(串行接口) +Router(config-if)#ip address 10.254.10.1 255.255.255.0 //配置s2/0接口IP +Router(config-if)#clock rate 64000 //必须配置时钟才可通信 +Router(config-if)#no shutdown //开启端口 +Router(config)#^Z +Router#show r + +``` + +```bash +Router1 基本配置 +Router>enable +Router#conf t +Router(config)#inter f0/0 //进入第0模块第0端口(快速以太网接口) +Router(config-if)#ip address 192.168.2.254 255.255.255.0 //配置f0/0接口IP +Router(config-if)#no shutdown //开启端口 +Router(config-if)#exit +Router(config)#interface serial 2/0 //进入第2模块第0端口(串行接口) +Router(config-if)#ip address 10.254.10.2 255.255.255.0 //配置s2/0接口IP +Router(config-if)#no shutdown //开启端口 +Router(config)#^Z +Router#show r + +``` + +```bash +Router0 静态路由配置 +Router>enable +Router#conf t +Router(config)#ip route 192.168.2.0 255.255.255.0 10.254.10.2 +# ip route 目标网络号 目标子网掩码 下一跳地址 +# 命令解读:当目的网络地址为192.168.2.0时,转发到端口地址为10.254.10.2处路由 +Router(config)#^Z +Router#show ip route + +``` + +```bash +Router1 静态路由配置 +Router>enable +Router#conf t +Router(config)#ip route 192.168.1.0 255.255.255.0 10.254.10.1 +(命令解读:参考以上) +Router(config)#^Z +Router#show ip route + +``` + +```bash +# 链路测试 +PC0和PC1(命令提示符CMD下) +ping 192.168.1.254 //链路通 +ping 10.254.10.2 //链路通 +ping 192.168.2.1 //链路通 +PC2(命令提示符CMD下) +ping 10.254.10.254 //链路通 +ping 192.168.1.2 //链路通 + +``` + +作业 + +```bash +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter +Router(config)#interface f +Router(config)#interface fastEthernet 0/0 +Router(config-if)#ip address 192.168.1.254 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +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)#exit +Router(config)# +Router(config)#inter +Router(config)#interface seri +Router(config)#interface serial 2/0 +Router(config-if)#ip add +Router(config-if)#ip address 10.254.10.1 255.255.255.0 +Router(config-if)#clo +Router(config-if)#clock ra +Router(config-if)#clock rate 64000 +Router(config-if)#no sh +Router(config-if)#no shutdown +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter +Router(config)#interface f +Router(config)#interface fastEthernet 0/0 +Router(config-if)#ip add +Router(config-if)#ip address 192.168.1.254 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +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)#exit +Router(config)# +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#inter +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter +Router(config)#interface ser +Router(config)#interface serial 2/0 +Router(config-if)#ip add +Router(config-if)#ip address 10.254.10.2 255.255.255.0 +Router(config-if)#no sh +Router(config-if)#no shutdown + +Router(config-if)# +%LINK-5-CHANGED: Interface Serial2/0, changed state to up + +Router(config-if)#exit + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#inter +Router(config)#interface f +Router(config)#interface fastEthernet 0/0 +Router(config-if)#ip add +Router(config-if)#ip address 192.168.3.254 255.255.255.0 +Router(config-if)#clo +Router(config-if)#no sh +Router(config-if)#no shutdown + +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)#exit +Router(config)#inter +Router(config)#interface ser +Router(config)#interface serial 3/0 +Router(config-if)#ip add +Router(config-if)#ip address 20.20.10.2 255.255.255.0 +Router(config-if)#clo +Router(config-if)#clock ra +Router(config-if)#clock rate 64000 +This command applies only to DCE interfaces +Router(config-if)#no sh +Router(config-if)#no shutdown +Router(config-if)#ip route 0.0.0.0.0.0.0.0 20.20.10.1 +%LINK-5-CHANGED: Interface Serial2/0, changed state to down +Router(config-if)#end +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#show r + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. +Router(config)#ip route 192.168.1.0 255.255.255.0 10.254.10.1 +Router(config)#end +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#ip r +Router#show ip r +Router#show ip route + +Router>en +Router#conf t +Enter configuration commands, one per line. End with CNTL/Z. + +Router(config)#ip +Router(config)#ip add +Router(config)#ip route 192.168.3.0 255.255.255.0 20.20.10.2 +Router(config)#end +Router# +%SYS-5-CONFIG_I: Configured from console by console + +Router#show ip route + +``` +