华为交换机划分vlan及路由配置

创建vlan

[center_switch]vlan 40                           

[center_switch-vlan40]quit

给vlan配置IP地址           

[center_switch]interface Vlanif 10      

[center_switch-Vlanif10] ip address 10.3.0.1   255.255.0.0

将端口加入vlan (少的话可以一个一个加,多了可以分组,将端口组加入vlan)

[center_switch] interface port GigabitEthernet 0/0/24

[center_switch-GigabitEthernet0/0/24]port link-type access

[center_switch-GigabitEthernet0/0/24]port default vlan10 

[center_switch-GigabitEthernet0/0/24]quit

[center_switch] interface port GigabitEthernet 0/0/23  

[center_switch-GigabitEthernet0/0/23]port link-type access

[center_switch-GigabitEthernet0/0/23]port default vlan10

创建端口组

[center_switch]port-group port1to8forvlan30

将相应的端口加入组中

[center_switch]port-group port1to8forvlan30]group-member GigabitEthernet 0/0/1 to GigabitEthernet 0/0/8

设置端口方式

[center_switch-port-group-port1to8forvlan30]port link-type access

设置端口组默认vlan(即之前创建好的vlan ID 30)

[center_switch-port-group-port1to8forvlan30]port default vlan 30

trunk口配置方式(trunk口为交换机与交换机之间vlan互相通信的接口,两台交换机trunk口互连即可)

进入接口

 port link-type trunk
 port trunk allow-pass vlan all

静态路由配置

ip route-static 0.0.0.0  0.0.0.0  10.0.0.1

猜你喜欢

转载自www.cnblogs.com/chenjiye/p/12060141.html