PC-1(config)#int f0/0 PC-1(config-if)#ip address 192.168.1.1 255.255.255.0 PC-1(config-if)#no sh PC-1(config-if)#exit PC-1(config)#no ip routing #关闭路由功能,做PC机 PC-1(config)#ip default-gateway 192.168.1.110 #设置默认网关 PC-1(config)#exit |
KC-S#vlan databa KC-S(vlan)#vlan 10 name 10 #创建编号和名称为20的vlan VLAN 10 added: Name: 10 KC-S(vlan)#apply APPLY completed. KC-S(vlan)#vlan 20 name 20 VLAN 20 added: Name: 20 KC-S(vlan)#apply APPLY completed. KC-S(vlan)#exit |
KC-S(config)#int f1/13 KC-S(config-if)#switchport access vlan 10 #将当前接口应用到vlan KC-S(config-if)#no sh KC-S(config-if)#exit KC-S(config)#int f1/14 KC-S(config-if)#switchport access vlan 10 KC-S(config-if)#exit KC-S(config)#int f1/15 KC-S(config-if)#switchport access vlan 20 KC-S(config-if)#exit KC-S#sh vlan-switch |
PC-1#ping 192.168.2.1 Type escape quence to abort. Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 conds: … Success rate is 0 percent (0/3) PC-2#ping 192.168.2.2 Type escape quence to abort. Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 conds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 56/76/96 ms PC-2# PC-3#ping 192.168.2.1 Type escape quence to abort. Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 conds: .!!!! Success rate is 80 percent (4/5), round-trip min/avg/max = 48/70/88 ms |
KC-S(config)#int f1/1 KC-S(config-if)#switchport mode trunk #f1/1设定为trunk模式 *Mar 1 00:27:29.035: %DTP-5-TRUNKPORTON: Port Fa1/1 has become dot1q trunk KC-S(config-if)#exit KC-S(config)#exit *Mar 1 00:27:37.735: %SYS-5-CONFIG_I: Configured from console by console KC-S#sh int trunk #piano是什么意思查看链路模式 小老鼠上灯台儿歌Port Mode Encapsulation Status Native vlan Fa1/1 on 802.1q trunking 1 |
KC-R(config)#int f0/0 KC-R(config-if)#no ip address #必须no ip address和no shutdown KC-R(config-if)#no shut KC-R(config-if)#exit KC-R(config)# 子接口配置: KC-R(config)#int f0/0.10 KC-R(config-subif)#encapsulation dot1Q 10 #设置trunk的封装协议 KC-R(config-subif)#ip address 192.168.1.110 255.255.255.0 KC-R(config-subif)#no shu KC-R(config-subif)#exit KC-R(config)#int f0/0.20 KC-R(config-subif)#encapsulation dot1Q 20 KC-R(config-subif)#ip address 192.168.2.220 255.255.255.0 liberateKC-R(config-subif)#no sh KC-R(config-subif)#exit |
PC-1#ping 192.168.2.1 Type escape quence to abort. Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 conds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 64/82/120 ms PC-1#ping 192.168.2.2 Type escape quence to abort. Sending 5, 100-byte ICMP Echos to 192.168.2.2, timeout is 2 conds: ..!!! Success rate is 60 percent (3/5), round-trip min/avg/max = 72/88/104 ms PC-1#ping 192.168.2.2 |
KC-R1(config)#ip route 0.0.0.0 0.0.0.0 173.16.1.128 #指向外网的静态路由 |
丧偶英文 |
KC-R1(config)#int f0/0 KC-R1(config-if)#ip nat inside #将f0/0英语四年级上册设置为内网口 *Mar 1 00:05:49.875: %LINEPROTO-5-UPDOWN: Line protocol on Interface NVI0, changed state to up KC-R1(config-if)#exit KC-R1(config)#int s1/0 KC-R1(config-if)#ip nat outside #将s1/0设置为外网口 KC-R1(config-if)#exit KC-R1(config)#ip nat inside source static 10.1.1.1 173.16.1.56 #静态NAT历年六级听力下载 KC-R1(config)#exit Ping测试: PC-1#ping 202.101.1.149 #测试证明能通 Type escape quence to abort. Sending 5, 100-byte ICMP Echos to 202.101.1.149, timeout is 2 conds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 120/122/132 ms 此时PC-1能通,PC-2不能通。 KC-R2#debug ip packet #查看数据包 *Mar 1 00:09:59.487: IP: tableid=0, s=10.1.1.2 (Serial1/0), d=173.16.1.128 (Serial1/0), routed via RIB *Mar 1 00:09:59.491: IP: s=10.1.1.2 (Serial1/0), d=173.16.1.128 (Serial1/0), len 100, rcvd 3 *Mar 1 00:09:59.495: IP: s=173.16.1.128 (local), d=10.1.1.2, len 100, unroutable …………………. *Mar 1 00:23:51.243: IP: s=202.101.1.149 (local), d=173.16.1.56 (Serial1/0), len 100, nding *Mar 1 00:23:51.447: IP: tableid=0, s=173.16.1.56 (Serial1/0), d=202.101.1.149 (Loopback0), routed via RIB |
KC-R1(config)# ip nat pool kachy 173.16.1.58 173.16.1.126 netmask 255.255.255.0 #创建地址池 KC-R1(config)#access-list 1 permit 10.1.1.0 0.0.0.255 #创建ACL KC-R1(config)#ip nat inside source list 1 pool kachy #二者关联 KC-R1(config)#exit Ping测试 PC-1#ping 202.101.1.149 #测试证明能通 Type escape quence to abort. Sending 5, 100-byte ICMP Echos to 202.101.1.149, timeout is 2 conds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 96/125/148 ms 2015广东高考英语PC-1#telnet 202.101.1.149 #测试证明能远程连接 Trying 202.101.1.149 … Open Password required, but none t [Connection to 202.101.1.149 clod by foreign host] 此时PC-2也可以ping通,telnet上。 查看当前KC-R1的NAT表。 KC-R1#sh ip nat translations #查看NAT表 Pro Inside global Inside local Outside local Outside global — 173.16.1.58 10.1.1.1 — — — 173.16.1.59 10.1.1.2 — — KC-R1# |
KC-R1(config)#access-list 100 permit ip 10.1.1.0 0.0.0.255 any #创建访问列表 KC-R1(config)#ip nat inside source list 100 interface s1/0 overload #二者关联,地址重载 KC-R1(config)#exit 测试 PC-1#ping 202.101.1.149 Type escape quence to abort. Sending 5, 100-byte ICMP Echos to 202.101.1.149, timeout is 2 conds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 84/97/116 ms kalPC-1# PC-1#telnet 202.101.1.149 Trying 202.101.1.149 … Open Password required, but none t [Connection to 202.101.1.149 clod by foreign host] 同样,PC-2也能到达。 高考英语口试在路由器KC-R1上 KC-R1#debug ip nat #查看翻译过程 *Mar 1 00:19:32.843: NAT*: s=10.1.1.1->173.16.1.56, d=202.101.1.149 [46610] *Mar 1 00:19:32.847: NAT*: s=10.1.1.1->173.16.1.56, d=202.101.1.149 [46611] *Mar 1 00:19:33.083: NAT*: s=202.101.1.149, d=173.16.1.56->10.1.1.1 [31823] 在路由器KC-R2上 KC-R2#debug ip packet *Mar 1 00:23:34.931: IP: tableid=0, s=173.16.1.56 (Serial1/0), d=202.101.1.149 (Loopback0), routed via RIB *Mar 1 00:23:34.935: IP: s=173.16.1.56 (Serial1/0), d=202.101.1.149, len 100, rcvd 4 *Mar 1 00:23:34.939: IP: tableid=0, s=202.101.1.149 (local), d=173.16.1.56 (Serial1/0), routed via FIB |
本文发布于:2023-05-23 09:54:00,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/fan/78/743650.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |