H3C 交换机配置命令学习

2020-04-16  本文已影响0人  余生似梦

1、开启三层路由功能

在接口配置模式下

[H3C] interface g1/0/1
[H3C-GigabitEthernet1/0/1] port link-mode route \\开启该接口的三层路由功能
[H3C-GigabitEthernet1/0/1] port link-mode bridge \\关闭该接口的三层路由功能

2、配置交换机接口

[H3C] interface g1/0/1
[H3C-GigabitEthernet1/0/1] ip add 192.168.1.1 255.255.0.0

3、配置交换机虚拟接口

[H3C] interface Vlan-interface 10
[H3C-Vlan-interface 10] ip add 192.168.1.1 255.255.0.0

4、配置交换机虚拟接口

配置端口的链路类型为Access类型

[H3C] vlan 10
[H3C-vlan10] port interface-list    \\向当前VLAN中添加一个或一组Access端口
[H3C-GigabitEthernet1/0/1] port link-type access   //缺省情况下,端口的链路类型为Access
[H3C-GigabitEthernet1/0/1] port access vlan 10 //将当前Access端口加入到指定VLAN

配置端口的链路类型为Trunk类型

[H3C-GigabitEthernet1/0/1] port link-type trunk
 缺省情况下,端口的链路类型为Access类型

允许指定的VLAN通过当前Trunk端口
[H3C-GigabitEthernet1/0/1] port trunk permit vlan { vlan-id-list | all }
 缺省情况下,Trunk端口只允许VLAN 1的报文通过
 
(可选)设置Trunk端口的缺省VLAN
[H3C-GigabitEthernet1/0/1]  port trunk pvid vlan vlan-id
 缺省情况下,Trunk端口的缺省VLAN为VLAN 1

静态链路聚合的典型配置

创建二层聚合端口

[H3C-A] interface Bridge-Aggregation 1  
[H3C-A-Bridge-Aggregation1] port link-type trunk
[H3C-A-Bridge-Aggregation1] port trunk permit vlan 10 20 30

分别将设备A上聚合端口加入到聚合组中

[H3C-A] interface Ethernet 1/0/1
[H3C-A-Ethernet1/0/1] port link-type trunk
[H3C-A-Ethernet1/0/1] port trunk permit vlan 10 20 30
[H3C-A-Ethernet1/0/1] port link-aggregation group 1

查看链路聚合命令

[H3C] display link-aggregation verbose

动态聚合模式

创建二层聚合端口

[H3C-A] interface Bridge-Aggregation 1  
[H3C-A-Bridge-Aggregation1] port link-type trunk
[H3C-A-Bridge-Aggregation1] port trunk permit vlan 10 20 30
[H3C-A-Bridge-Aggregation1] link-aggreation mode dynamic

配置OSPF

[H3C]router id 1.1.1.1
[H3C]ospf 10
[H3C-ospf-1]area 0
[H3C-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0  # 要发布的路由
上一篇下一篇

猜你喜欢

热点阅读