一 华三交换机
1.交换接口切换为路由接口
interface GigabitEthernet 1/0/24 port link-mode route # 切换为三层路由接口 ip address 192.168.100.2 24
2.路由接口切换为交换接口
vlan 100
interface GigabitEthernet 1/0/24
port link-mode bridge # 切换为交换接口
port link-type access port default vlan 100
interface GigabitEthernet 1/0/1
port link-mode bridge # 切换为交换接口
port link-type trunk port trunk permit vlan 10 100
二 华为交换机
1.交换接口切换为路由接口
interface GigabitEthernet 1/0/24 undo portswitch # 切换为三层路由接口 ip address 192.168.100.2 24
2.路由接口切换为交换接口
vlan 100
interface GigabitEthernet 1/0/24
portswitch # 切换为交换接口
port link-type access port default vlan 100
interface GigabitEthernet 1/0/1
portswitch # 切换为交换接口
port link-type trunk port trunk allow vlan 10 100
三 锐捷/迈普交换机
!
interface gi0/24
no switchport # 切换为三层路由接口
ip address 192.168.100.2 255.255.255.0
!
vlan 100
interface gi0/24
switchport # 切换为交换接口
switchport mode access
switchport access vlan 100
!
interface gi0/1
switchport # 切换为交换接口
switchport mode trunk
switchport trunk allowed vlan only 20,30
!
四 中兴交换机
$
interface xlgei-0/2/0/1
switch attribute disable # 切换为三层路由接口
ip address 192.168.100.2 24
$
vlan 100
interface xlgei-0/1/0/36
switch attribute enable # 切换为交换接口
switchport mode access
switchport access vlan 100
$
interface xlgei-0/1/0/1
switch attribute enable # 切换为交换接口
switchport mode trunk
switchport trunk vlan 100
$