Cisco路由器搭建单臂路由
资料简介:
在企业中,使用单臂路由频率是很高的,单臂路由的大概意思就是:一个路由器只有一个接口,然后它这个接口下面有多个VLAN(虚拟局域网),交换机之间的VLAN是不能互相访问的,这时只能通过路由器,单臂路由的功能就是把只一个接口的路由器分成几个虚拟子接口。这样不同的VLAN之间就可以互相访问了.
CISCO 2811 配置:
route(config)# int fa 0/0
route(config-if)# int fa 0/0.100
route(config-subif)# encapsulation dot1Q 1 = 表示100的子接口连接到VLAN1
route(config-subif)# ip address 192.168.10.1 255.255.255.0
route(config-subif)# no shutdown
route(config-if)# int fa 0/0.200
route(config-subif)# encapsulation dot1Q 2 = 表示200的子接口连接到VLAN2
route(config-subif)# ip address 192.168.0.1 255.255.255.0
route(config-subif)# no shutdown
CISCO 3560 配置:
Switch# vlan database
Switch(vlan)# vlan 1 name baidu
Switch(config)# int fa 0/2
Switch(config-if)# switchport access vlan 1
Switch# vlan database
Switch(vlan)# vlan 2 name google
Switch(config)# int fa 0/3
Switch(config-if)# switchport access vlan 2
Switch(config)# int fa 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
两台PC 配置:
PC1 IP 为: 192.168.10.3 255.255.255.0 网关:192.168.10.1
PC2 IP 为: 192.168.0.3 255.255.255.0 网关:192.168.0.1
到此两个VLAN就能互通了.
PS:其实我自己都N年没碰思科路由器了,这还是当年的笔记。
CISCO 2811 配置:
route(config)# int fa 0/0
route(config-if)# int fa 0/0.100
route(config-subif)# encapsulation dot1Q 1 = 表示100的子接口连接到VLAN1
route(config-subif)# ip address 192.168.10.1 255.255.255.0
route(config-subif)# no shutdown
route(config-if)# int fa 0/0.200
route(config-subif)# encapsulation dot1Q 2 = 表示200的子接口连接到VLAN2
route(config-subif)# ip address 192.168.0.1 255.255.255.0
route(config-subif)# no shutdown
CISCO 3560 配置:
Switch# vlan database
Switch(vlan)# vlan 1 name baidu
Switch(config)# int fa 0/2
Switch(config-if)# switchport access vlan 1
Switch# vlan database
Switch(vlan)# vlan 2 name google
Switch(config)# int fa 0/3
Switch(config-if)# switchport access vlan 2
Switch(config)# int fa 0/1
Switch(config-if)# switchport mode trunk
Switch(config-if)# switchport trunk encapsulation dot1q
两台PC 配置:
PC1 IP 为: 192.168.10.3 255.255.255.0 网关:192.168.10.1
PC2 IP 为: 192.168.0.3 255.255.255.0 网关:192.168.0.1
到此两个VLAN就能互通了.
PS:其实我自己都N年没碰思科路由器了,这还是当年的笔记。
2012-02-07
浏览2300
下载0