首页 > 代码库 > 【实验】路由器远程登录与单臂路由
【实验】路由器远程登录与单臂路由
远程登录:
主机进入终端模式;
Router>enable Router#conf t Router(config)#enable secret 123456 //设置enable密码 Router(config)#line vty 0 4 //设置远程登录机数为5台 Router(config-line)#password cisco //远程登录密码为cisco Router(config-line)#login //登录时验证 Router(config-line)#exit Router(config)#interface fa 0/0 Router(config-if)#ip addre Router(config-if)#ip address 10.2.3.254 255.255.255.0 //给接口配置IP地址,远程机的网关 Router(config-if)#no shut Router(config-if)#end
远程登录机进行登录:
单臂路由
两个VLAN之间的通讯可以通过一个路由器解决。
交换机:
Switch>enable Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10 Switch(config-vlan)#exit Switch(config)#vlan 20 Switch(config-vlan)#exit //定义两个VLAN Switch(config)# Switch(config)#interface fa 0/2 Switch(config-if)#switchport access vlan 10 Switch(config-if)#exit Switch(config)#interface fa 0/3 Switch(config-if)#switchport access vlan 20 Switch(config-if)#exit Switch(config)#interface f 0/1 Switch(config-if)#switchport mode trunk //F 0/1定义为Trunk模式 Switch(config-if)#exit Switch(config)#
路由器:
Router>enable Router# Router#conf t Enter configuration commands, one per line. End with CNTL/Z. Router(config)#inter f 0/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)# Router(config-if)#exit Router(config)# Router(config)#inter f 0/0.1 //进入F0/0的子接口 F0/0.1 Router(config-subif)# %LINK-5-CHANGED: Interface FastEthernet0/0.1, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.1, changed state to up Router(config-subif)#encapsulation dot1Q 10 Router(config-subif)#ip address 192.168.10.254 255.255.255.0 Router(config-subif)#exit Router(config)#inter f 0/0.2 Router(config-subif)# %LINK-5-CHANGED: Interface FastEthernet0/0.2, changed state to up %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0.2, changed state to up Router(config-subif)#encapsulation Dot1Q 20 Router(config-subif)#ip address 192.168.20.254 255.255.255.0 Router(config-subif)#exit Router(config)# 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 //显示两条直连路由 C 192.168.10.0/24 is directly connected, FastEthernet0/0.1 C 192.168.20.0/24 is directly connected, FastEthernet0/0.2 Router#
PC1 ping PC1结果:
本文出自 “赵玉强的博客” 博客,请务必保留此出处http://zhaoyuqiang.blog.51cto.com/6328846/1580288
【实验】路由器远程登录与单臂路由
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。