码迷,mamicode.com
首页 > 其他好文 > 详细

【实验】路由器远程登录与单臂路由

时间:2014-11-20 23:55:21      阅读:376      评论:0      收藏:0      [点我收藏+]

标签:路由器 单臂路由 远程登录 网络 cisco

远程登录:


bubuko.com,布布扣

主机进入终端模式;

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

远程登录机进行登录:

bubuko.com,布布扣




单臂路由

bubuko.com,布布扣

两个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结果:

bubuko.com,布布扣

本文出自 “赵玉强的博客” 博客,请务必保留此出处http://zhaoyuqiang.blog.51cto.com/6328846/1580288

【实验】路由器远程登录与单臂路由

标签:路由器 单臂路由 远程登录 网络 cisco

原文地址:http://zhaoyuqiang.blog.51cto.com/6328846/1580288

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!