编写一个新华三交换机配置脚本,1-16为GE口,7-20为Ten-GE口,要求流量从1口打入,2口打出,所有的端口流量都打满
时间: 2024-03-17 14:39:56 浏览: 153
交换机配置脚本
好的,以下是基于新华三交换机的配置脚本:
```
# 进入系统视图
system-view
# 配置GE口
interface GigabitEthernet 1/0/1
port link-mode bridge
port link-type access
undo port hybrid vlan 1
port default vlan 1
shutdown
interface GigabitEthernet 1/0/2
port link-mode bridge
port link-type access
undo port hybrid vlan 1
port default vlan 1
shutdown
# 配置Ten-GE口
interface Ten-GigabitEthernet 1/0/7
port link-mode bridge
port link-type access
undo port hybrid vlan 1
port default vlan 1
shutdown
interface Ten-GigabitEthernet 1/0/8
port link-mode bridge
port link-type access
undo port hybrid vlan 1
port default vlan 1
shutdown
# 配置流量
interface GigabitEthernet 1/0/1
traffic-policy inbound test
interface GigabitEthernet 1/0/2
traffic-policy outbound test
interface Ten-GigabitEthernet 1/0/7
traffic-policy inbound test
interface Ten-GigabitEthernet 1/0/8
traffic-policy outbound test
# 配置流量策略
traffic classifier test operator or
if-match any
traffic behavior test
car cir 1000000 cbs 10000000
traffic policy test
classifier test behavior test
# 配置开启端口
interface GigabitEthernet 1/0/1
undo shutdown
interface GigabitEthernet 1/0/2
undo shutdown
interface Ten-GigabitEthernet 1/0/7
undo shutdown
interface Ten-GigabitEthernet 1/0/8
undo shutdown
```
这个配置脚本中,我们首先进入系统视图,然后分别配置了1-16号端口和7-20号端口。接着,我们配置了流量策略,指定了所有流量都要经过策略。最后,我们开启了1、2、7、8号端口,使得流量可以正常通过这些端口。请注意,这个脚本只是一个示例,具体配置可能需要根据实际情况进行调整。
阅读全文