配置端口trunk允许VLAN1和VLAN2通过的命令参数与HW3328不同:
[H3C3628-Ethernet1/0/2]port trunk ?
permit allowed VLANs
//H3C vlan trunk allow
参数
pvid
Specify current trunk port's PVID VLAN characteristics
***********************************************************************
[HW3328-Ethernet0/0/2]port trunk ?
allow-pass Allowed vlan
//HW vlan trunk allow
参数
***********************************************************************
问题:配置时提示不支持TRUNK!!!:
[H3C3628-Ethernet1/0/2]port trunk permit vlan 1 TO 2
This port is not a TRUNK port!
端口默认格式为:
interface Ethernet1/0/2
port
access vlan 2
看来H3C和华为还是不同,要改端口模式为TRUNK(但是奇怪的是,现在的2326下的电脑能获取到VLAN2(10.10.0.0/24)的IP,并且能正常访问网络了。
将端口2模式更改为TRUNK:
[H3C3628-Ethernet1/0/2]port link-type ?
access
Access link-type
hybrid
Hybrid VLAN link-type
irf-fabric Fabric-port link-type
trunk
VLAN trunk link-type
[H3C3628-Ethernet1/0/2]port link-type trunk
//将端口2模式更改为TRUNK
%Apr 2 18:56:40:690 2000 H3C3628 L2INF/5/VLANIF LINK STATUS CHANGE:- 1 - Vlan-interface2 is
DOWN
***网络中断了,2326上的电脑无法PING通192.168.0.0/16网段。
将端口2设置为TRUNK 并允许VLAN1 和VLAN2通过:
[H3C3628-Ethernet1/0/2]port trunk permit vlan 1 to 2
Please wait... Done.
[H3C3628-Ethernet1/0/2]
%Apr 2 19:00:04:963 2000 H3C3628 L2INF/5/VLANIF LINK STATUS CHANGE:- 1 - Vlan-interface2 is UP
%Apr 2 19:00:05:084 2000 H3C3628 IFNET/5/UPDOWN:- 1 -Line protocol on the interface Vlan-interface2 is
UP
设置OK,端口2为UP状态。
在2326的电脑上测试网络是否通,我靠,改为TRUNK模式后,网络中断了,然后改为ACCESS模式,也中断了,连10.10.0.0/24的路由也没有了。。。。。:
[H3C3628-Ethernet1/0/2]dis ip rou
Routing Table: public net
Destination/Mask
Protocol Pre Cost Nexthop Interface
0.0.0.0/0
STATIC 60 0 192.168.0.2 Vlan-interface1
127.0.0.0/8
DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32
DIRECT 0 0 127.0.0.1 InLoopBack0
192.168.0.0/16
DIRECT 0 0 192.168.0.11 Vlan-interface1
192.168.0.11/32
DIRECT 0 0 127.0.0.1 InLoopBack0
看来要重新配置:
(1).重新将端口2加入VLAN2:
[H3C3628-vlan2]
%Apr 2 19:13:23:700 2000 H3C3628 L2INF/5/VLANIF LINK STATUS CHANGE:- 1 - Vlan-interface2 is UP
%Apr 2 19:13:23:820 2000 H3C3628 IFNET/5/UPDOWN:- 1 -Line protocol on the interface Vlan-interface2 is UP
[H3C3628-vlan2]dis ip rou
Routing Table: public net
Destination/Mask
Protocol Pre Cost Nexthop Interface
0.0.0.0/0
STATIC 60 0 192.168.0.2 Vlan-interface1
10.10.0.0/24
DIRECT 0 0 10.10.0.1 Vlan-interface2
10.10.0.1/32
DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.0/8
DIRECT 0 0 127.0.0.1 InLoopBack0
127.0.0.1/32
DIRECT 0 0 127.0.0.1 InLoopBack0
192.168.0.0/16
DIRECT 0 0 192.168.0.11 Vlan-interface1
192.168.0.11/32
DIRECT 0 0 127.0.0.1 InLoopBack0
(2).到2326上测试,网络通了。连接到2326的电脑也通了。查看H3C3628的系统参数,此时端口2还是为ACCSEE模式。
(3).下面再来测试将端口2改为TRUNK模式,不通,查阅资料得知,还需指定端口2的缺省VLAN(未设置的缺省VLAN是VLAN1),汗死了,还有这个。命令如下:
[H3C3628-Ethernet1/0/2]port trunk pvid vlan 2
执行上述命令后,网络通了,配置文件如下:
<H3C3628>dis cu
#
sysname H3C3628
#
radius scheme system
#
domain system
#
vlan 1 to 2
#
interface Vlan-interface1
ip address 192.168.0.11 255.255.0.0
#
interface Vlan-interface2
ip address 10.10.0.1 255.255.255.0
#
interface Aux1/0/0
#
interface Ethernet1/0/1
#
interface Ethernet1/0/2
port link-type trunk
port trunk permit vlan 1 to 2
port trunk pvid vlan 2
#
ip route-static 0.0.0.0 0.0.0.0 192.168.0.2 preference 60
#
user-interface aux 0 7
user-interface vty 0 4
#
return