实验二拓扑图如下:
一、配置PC1、PC2
二、配置LSW和R1
交换机配置
vlan batch 100 200
interface GigabitEthernet0/0/1
port link-type access
port default vlan 200
interface GigabitEthernet0/0/2
port link-type access
port default vlan 100
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 100 200
路由器配置
interface Ethernet0/0/0100
dot1q termination vid 100
ip address 192168101 2552552550
arp broadcast enable
interface Ethernet0/0/0200
dot1q termination vid 200
ip address 192168201 2552552550
单臂路由
路由器配置:
1设置F0/0接口无IP,开启接口。
interface FastEthernet0/0
no ip address
2在FA0/0接口上设置两个子接口,分别更改封装为DOT1Q,并设置各自的IP地址。
interface FastEthernet0/01
encapsulation dot1Q 2
ip address 1111 2552552550
!
interface FastEthernet0/02
encapsulation dot1Q 3
ip address 2221 2552552550
要注意的是这里的VLAN号码要和交换机中的VLAN号对应起来。
交换机配置:
首先在交换机上划分两个VLAN。
Vlan 2 name pc1
Vlan 3 name pc2
1 将交换机连接路由器的接口设置为TRUNK。
interface FastEthernet1/5
switchport mode trunk
!
2 将交换机连接两台PC的接口绑定到不同的VLAN中去。
interface FastEthernet1/11
switchport access vlan 2
!
interface FastEthernet1/12
switchport access vlan 3
PC配置:
给PC的F0/0接口设置与路由器对应子接口同一网段的IP地址。
PC1
interface FastEthernet0/0
ip address 1112 2552552550
!
PC2
interface FastEthernet0/0
ip address 2222 2552552550
!
给两个PC分别设置一条缺省路由,将出口指向F0/0,即划分入VLAN的接口。
ip route 0000 0000 FastEthernet0/0
至此,单臂路由的实验配置完成。测试的时候在PC1上PING一下PC2,应该可以看到结果。
要点:1,注意子接口的IP要和PC的IP在同一网段。2,要确保所有接口的配置正确,并都打开了接口。3,作为PC使用的路由器上必须配置有正确的路由条目。
例子:
s2960一台,r2811一台,PC2台
SW#vlan database
SW(vlan)#vlan 2
VLAN 2 added:
Name: VLAN0002
SW(vlan)#vlan 3
VLAN 3 added:
Name: VLAN0003
SW(vlan)#exit
SW(config)#int f0/2
SW(config-if)#switchport mode access
SW(config-if)#switchport access vlan 2
SW(config-if)#no shutdown
SW(config-if)#int f0/3
SW(config-if)#switchport mode access
SW(config-if)#switchport access vlan 3
SW(config-if)#no shutdown
SW(config-if)#int f0/1
SW(config-if)#switchport mode trunk
SW(config-if)#no shutdown
路由器配置如下:
R(config)#int f0/0
R(config-if)#no shutdown
R(config-if)#int f0/02
R(config-subif)#encapsulation dot1q 2
R(config-subif)#ip address 1921682254 2552552550
R(config-subif)#no shutdown
R(config-subif)#int f0/03
R(config-subif)#encapsulation dot1q 3
R(config-subif)#ip address 1921683254 2552552550
R(config-subif)#no shutdown
R(config-subif)#end
客户机配置如下:
HostA:
ip:19216821/24
ip default-gateway:1921682254
HostB:
ip:19216831/24
ip default-gateway:1921683254
以上就是关于华为[ENSP]VLAN间路由的配置(单臂路由、多臂路由的配置)全部的内容,包括:华为[ENSP]VLAN间路由的配置(单臂路由、多臂路由的配置)、思科配置单臂路由 举个例子、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!