swconfig是交换接口(switch)配置命令。
1swconfig list ; 列出可用的SWITCH设备信息(dev参数) 2Found: switch0 - ag71xx-mdio.0 3swconfig dev switch0 help ; 查询该设备信息 4switch0: ag71xx-mdio.0(Atheros AR8337), ports: 7 (cpu @ 0), vlans: 128 5 --switch 6 Attribute 1 (int): enable_vlan (Enable VLAN mode) 7 Attribute 2 (none): reset_mibs (Reset all MIB counters) 8 Attribute 3 (int): enable_mirror_rx (Enable mirroring of RX packets) 9 Attribute 4 (int): enable_mirror_tx (Enable mirroring of TX packets) 10 Attribute 5 (int): mirror_monitor_port (Mirror monitor port) 11 Attribute 6 (int): mirror_source_port (Mirror source port) 12 Attribute 7 (string): arl_table (Get ARL table) 13 Attribute 8 (none): apply (Activate changes in the hardware) 14 Attribute 9 (none): reset (Reset the switch) 15 --vlan 16 Attribute 1 (int): vid (VLAN ID (0-4094)) 17 Attribute 2 (ports): ports (VLAN port mapping) 18 --port 19 Attribute 1 (none): reset_mib (Reset single port MIB counters) 20 Attribute 2 (string): mib (Get port's MIB counters) 21 Attribute 3 (int): enable_eee (Enable EEE PHY sleep mode) 22 Attribute 4 (int): pvid (Primary VLAN ID) 23 Attribute 5 (string): link (Get port link information) 24swconfig dev <dev> [port <port>|vlan <vlan>] (help|set <key> <value>|get <key>|load <config>|show) ;设置switch,port,vlan 25swconfig dev switch0 show ;显示switch信息
示例:
1显示switch0/eth1 port 2~# swconfig dev eth1 show 3Global attributes: 4 enable_vlan: 1 5Port 0: 6 pvid: 1 7 link: port:0 link:up speed:1000baseT full-duplex txflow rxflow 8Port 1: 9 pvid: 1 10 link: port:1 link:down 11Port 2: 12 pvid: 1 13 link: port:2 link:down 14Port 3: 15 pvid: 1 16 link: port:3 link:down 17Port 4: 18 pvid: 1 19 link: port:4 link:down 20VLAN 1: 21 vid: 1 22 ports: 0 1 2 3 4 23~# swconfig list 24Found: switch0 - eth1