Juniper ex4200的一些命令

查询交换机所有端口状态 show interfaces terse
查询交换机所有端口描述 show interfaces descriptions
查询交换机端口下当前配置 show configuration interfaces xx-x/x/x | display set
查询端口流量普通信息 show interfaces xx-x/x/x
查询端口流量详细流量统计 show interfaces xx-x/x/x extensive
查询 vlan show vlans
查询 Mac 地址 show ethernet-switching table
查看log show log message
查看限速模板 show firewall
查看交换机所有配置 show configuration | display set
查询arp show arp

配置带宽限速
set firewall policer P100M if-exceeding bandwidth-limit 100m burst-size-limit 10m
set firewall policer P100M then discard
set firewall family ethernet-switching filter 100m term all then policer P100M
set firewall family ethernet-switching filter 100m interface-specific
配置端口带宽限速
set interfaces xx-x/x/x unit 0 family ethernet-switching filter output 100m
set interfaces xx-x/x/x unit 0 family ethernet-switching filter input 100m
配置端口描述
set interfaces xx-x/x/x description xxxx
配置端口接入模式
set interfaces xx-x/x/x unit 0 family ethernet-switching interface-mode trunk/access
配置端口vlan
set interfaces xx-x/x/x unit 0 family ethernet-switching vlan members xxxx
关闭端口
set interfaces xx-x/x/x disable
开启端口
delete interfaces xx-x/x/x disable
创建vlan
set vlans xxx vlan-id xxx
删除vlan
delete vlans xxx


show configuration | display set | match “ge-0/0/31” 这个是查限速的,“”里面的关键词根据想查询的内容更改
set interfaces ge-0/0/0 unit 0 family ethernet-switching filter input 100M 这条是进限速,

set class-of-service interfaces ge-0/0/0 shaping-rate 200m
是出限速


【流入流出是对交换机而言:】
set interfaces ge-0/0/0 ether-options speed 100m       默认限速方式: 只能 10 / 100 /  1000

流入: 
set firewall policer 100M if-exceeding bandwidth-limit 100m
set firewall policer 100M if-exceeding burst-size-limit 1m
set firewall policer 100M then discard 

set firewall family ethernet-switching filter 100M term 100M then policer 100M

set interfaces ge-0/0/0 unit 0 family ethernet-switching filter input 100M

流出:set class-of-service interfaces ge-0/0/0 shaping-rate 200m

原创文章,作者:kinponet,如若转载,请注明出处:https://www.yidc.net/archives/147