Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#inter f0/0
Router(config-if)#ip ad
Router(config-if)#ip address 222.0.2.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
Router(config-if)#inter f0/1
Router(config-if)#ip address 222.0.1.2 255.255.255.0
Router(config-if)#no shut
Router(config-if)#
Router(config-if)#ex
Router(config)#ip route 192.168.1.0 255.255.255.0 222.0.1.1
Router(config)#end
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router#
Router#show ip rou
Router#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
S 192.168.1.0/24 [1/0] via 222.0.1.1
C 222.0.1.0/24 is directly connected, FastEthernet0/1
C 222.0.2.0/24 is directly connected, FastEthernet0/0
Router#
Router(config-if)#inter f0/0
Router(config-if)#ip add 222.0.1.1 255.255.255.0
Router(config-if)#inter f0/1
Router(config-if)#ip add 192.168.1.1 255.255.255.0
Router(config-if)#no shut
Router(config-if)#exit
Router(config)#
Router(config)#ip route 222.0.2.0 255.255.255.0 222.0.1.2
Router(config)#end
Router#show ip route
C 192.168.1.0/24 is directly connected, FastEthernet0/1
C 222.0.1.0/24 is directly connected, FastEthernet0/0
S 222.0.2.0/24 [1/0] via 222.0.1.2
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#inter f0/1
Router(config-if)#ip nat inside ?
<cr>
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config-if)#inter f0/0
Router(config-if)#ip nat outside
Router(config-if)#ex
Router(config)#ip nat inside source static ?
Router(config)#ip nat inside source static 192.168.1.2 222.0.1.3 ?
<cr>
Router(config)#ip nat inside source static 192.168.1.2 222.0.1.3
Router(config)#end
Router#
Router#show ip nat tr
Router#show ip nat translations
Pro Inside global Inside local Outside local Outside global
--- 222.0.1.3 192.168.1.2 --- ---
Router>enable
Router#show ip nat translations
Pro Inside global Inside local Outside local Outside global
icmp 222.0.1.3:16 192.168.1.2:16 222.0.2.2:16 222.0.2.2:16【ping的结果】
单臂路由:
![](https://images.cnblogs.com/OutliningIndicators/ContractedBlock.gif)
1)划分vlan 2)端口的合并使用 1.Router(config)#hostname R1 R1(config)#interface fa0/0#要合并使用的一个端口 R1(config-if)#no shutdown R1(config-if)#exit R1(config)#interface fa0/0.1#分配一号接口,有多少个结合线路,就有多少个0.1->0.n R1(config-subif)#encapsulation dot1Q 10#封装技术,vlan R1(config-subif)#ip address 192.168.1.1 255.255.255.0#添加网关地址。 R1(config-subif)#exit 注意 一般不知道的请使用使用auto线 路由器--交叉线--路由器 路由器--交叉线--PC 路由器--直通线--交换机 交换机--直通线--PC 总结为三大步: 1)进入端口,开启服务 2)按照情况切割端口 3)封装端口及vlan和添加网关作为下一跳 参考:https://www.cnblogs.com/mchina/tag/Packet%20Tracer/
本文来自博客园,作者:topass123,转载请注明原文链接:https://www.cnblogs.com/topass123/p/12891484.html