swconfig--交换接口配置命令

Posted yuxi_o

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了swconfig--交换接口配置命令相关的知识,希望对你有一定的参考价值。

 swconfig是交换接口(switch)配置命令。

swconfig list ; 列出可用的SWITCH设备信息(dev参数)
Found: switch0 - ag71xx-mdio.0
swconfig dev switch0 help ; 查询该设备信息
switch0: ag71xx-mdio.0(Atheros AR8337), ports: 7 (cpu @ 0), vlans: 128
     --switch
    Attribute 1 (int): enable_vlan (Enable VLAN mode)
    Attribute 2 (none): reset_mibs (Reset all MIB counters)
    Attribute 3 (int): enable_mirror_rx (Enable mirroring of RX packets)
    Attribute 4 (int): enable_mirror_tx (Enable mirroring of TX packets)
    Attribute 5 (int): mirror_monitor_port (Mirror monitor port)
    Attribute 6 (int): mirror_source_port (Mirror source port)
    Attribute 7 (string): arl_table (Get ARL table)
    Attribute 8 (none): apply (Activate changes in the hardware)
    Attribute 9 (none): reset (Reset the switch)
     --vlan
    Attribute 1 (int): vid (VLAN ID (0-4094))
    Attribute 2 (ports): ports (VLAN port mapping)
     --port
    Attribute 1 (none): reset_mib (Reset single port MIB counters)
    Attribute 2 (string): mib (Get ports MIB counters)
    Attribute 3 (int): enable_eee (Enable EEE PHY sleep mode)
    Attribute 4 (int): pvid (Primary VLAN ID)
    Attribute 5 (string): link (Get port link information)
swconfig dev <dev> [port <port>|vlan <vlan>] (help|set <key> <value>|get <key>|load <config>|show) ;设置switch,port,vlan
swconfig dev switch0 show ;显示switch信息

示例:

显示switch0/eth1 port
~# swconfig dev eth1 show
Global attributes:
    enable_vlan: 1
Port 0:
    pvid: 1
    link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 
Port 1:
    pvid: 1
    link: port:1 link:down
Port 2:
    pvid: 1
    link: port:2 link:down
Port 3:
    pvid: 1
    link: port:3 link:down
Port 4:
    pvid: 1
    link: port:4 link:down
VLAN 1:
    vid: 1
    ports: 0 1 2 3 4 
~# swconfig list
Found: switch0 - eth1

 

以上是关于swconfig--交换接口配置命令的主要内容,如果未能解决你的问题,请参考以下文章

华为交换机VLAN配置命令

华为命令解释

华为交换机配置好以后,用啥命令查看以配置的信息。

华为链路聚合配置命令

思科交换机 interface port-channel 5 命令有啥用??

cisco交换机安全配置设定命令(2)