上一篇: 下一篇:

单臂路由的完整配置

2010年03月15日  |  2:37 下午分类:Netwroking  |  266 views

1、设置虚拟PC的IP
 ip 192.168.10.1 192.168.10.254
设置网管是为了跨区域通讯。
查看IP地址sh

2、进设备
配置基本的
Router#configure terminal   #进入到配置模式下
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname SW1  #更改交换机的名称
SW1(config)#no ip domain lookup   #关闭查询功能
SW1(config)#line console 0
SW1(config-line)#logging synchronous   #同步日志
SW1(config-line)#exec-timeout 0 0     #配置为永远不超时 exec-

timeout 0 10  表示登录后无操作10秒后超时登出,这时候就要重新输入密

码登陆设备。
SW1(config-line)#end
以上的命令路由器和交换机上都要做

3、关闭每台交换机的路由功能
SW1(config)#no ip routing

4、做两天交换机之间的trunk和以太接口

SW1(config)#interface range fastEthernet0/14 – 15 #进入交换机1的14

和15端口
SW1(config-if-range)#channel-group 1 mode on   #绑定为以太口
SW1(config)#int port-channel 1  #进入以太口
SW1(config-if)#switchport trunk encapsulation dot1q  #做trunk并做

dot1q的封装。
SW1(config-if)#switchport mode trunk #设置为trunk模式
SW1(config-if)#no sh #激活端口

上面的几步在sw2上也要做验证trunk的命令如下
SW1#show interfaces trunk
Port      Mode         Encapsulation  Status        Native vlan
Fa0/0     on           802.1q         trunking      1
Po1       on           802.1q         trunking      1

Port      Vlans allowed on trunk
Fa0/0     1-1005
Po1       1-1005

Port      Vlans allowed and active in management domain
Fa0/0     1,10,20
Po1       1,10,20

Port      Vlans in spanning tree forwarding state and not pruned
Fa0/0     1,10,20
Po1       1,10,20
5、创建vlan和做vtp
SW1#vlan database    #通过数据库模式创建vlan
SW1(vlan)#vlan 10 name fin    #创建vlan 10 并命名
VLAN 10 added:
    Name: fin
SW1(vlan)#vlan 20 name mar
VLAN 20 added:
    Name: mar
SW1(vlan)#vtp ?   #设置vtp,查看vtp命令
  client       Set the device to client mode.
  domain       Set the name of the VTP administrative domain.
  password     Set the password for the VTP administrative domain.
  pruning      Set the administrative domain to permit pruning.
  server       Set the device to server mode.
  transparent  Set the device to transparent mode.
  v2-mode      Set the administrative domain to V2 mode.

SW1(vlan)#vtp server   #设置vtp模式
Device mode already VTP SERVER. 

SW1(vlan)#vtp domain cisco    #设置vtp域名
Changing VTP domain name from NULL to cisco

SW1(vlan)#vtp pruning  #开启裁剪模式
Pruning switched ON

SW1(vlan)#vtp password 123  #设置vtp密码
Setting device VLAN database password to 123.
SW1(vlan)#exit

在SW1上做完vtp后,在进入到SW2中做vtp,在SW2上做了vtp后SW2就可以把

SW1上的vlan学习到了。

6、通过vtp效验
SW1#sh vtp status
VTP Version                     : 2
Configuration Revision          : 1
Maximum VLANs supported locally : 256
Number of existing VLANs        : 7
VTP Operating Mode              : Server
VTP Domain Name                 : cisco
VTP Pruning Mode                : Enabled
VTP V2 Mode                     : Disabled
VTP Traps Generation            : Disabled
MD5 digest                      : 0×81 0xE9 0×5C 0×99 0xDA 0×01

0xCE 0×3A
Configuration last modified by 0.0.0.0 at 3-1-02 00:14:30
Local updater ID is 0.0.0.0 (no valid interface found)
比较两台交换机上的MD5值,如果一样则证明vtp是通的

7、将端口加入到vlan中
SW1(config)#int fa0/1
SW1(config-if)#switchport mode access 

SW1(config-if)#switchport access vlan 10 
SW1(config-if)#no sh

8、做sw1与R1的trunk
SW1(config-if)#int fa0/0    
SW1(config-if)#switchport tr
SW1(config-if)#switchport trunk en do
SW1(config-if)#switchport mode trunk
SW1(config-if)#no sh

9、配置路由
R1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int fa0/0
R1(config-if)#no ip address 
R1(config-if)#no sh

01:00:53: %LINEPROTO-5-UPDOWN: Line protocol on Interface

FastEthernet0/0, changed state to up
R1(config-if)#
R1(config)#interface fastEthernet0/0.1  #进入子端口
R1(config-subif)#encapsulation dot1Q 10  #封装到vlan 10

R1(config-subif)#ip add 192.168.10.254 255.255.255.0 #对子端口进行

ip配置
R1(config-subif)#no sh
R1(config-subif)#int fa0/0.2
R1(config-subif)#encapsulation dot1Q 20
R1(config-subif)#ip address 192.168.20.254 255.255.255.0
R1(config-subif)#no sh
R1(config-subif)#int fa0/0.1

10、验证正确性,在虚拟pc1上ping虚拟pc2的网关。

喜欢本文,那就收藏到: Del.icio.us Google书签 Digg Live Bookmark Technorati Furl Yahoo书签 Facebook 百度搜藏 新浪ViVi 365Key网摘 天极网摘 和讯网摘 博拉网 POCO网摘 添加到饭否 QQ书签 Digbuzz我挖网
  • 暂无相关日志

发表您的评论

Դ