The program swconfig allows you to configure configurable Ethernet network switches.

Usage examples


  • swconfig list
  • swconfig dev switch0 show
  • Show current configuration
    swconfig dev rtl8366rb show
    and you will obtain:
    VLAN 1:
            info: VLAN 1: Ports: '12345t', members=003e, untag=001e, fid=0
            fid: 0
            ports: 1 2 3 4 5t
    VLAN 2:
            info: VLAN 2: Ports: '05t', members=0021, untag=0001, fid=0
            fid: 0
            ports: 0 5t
  • Show available features
    swconfig dev rt305x help
    switch0: rt305x(rt305x-esw), ports: 7 (cpu @ 6), vlans: 4096
            Attribute 1 (int): enable_vlan (VLAN mode (1:enabled))
            Attribute 2 (int): alternate_vlan_disable (Use en_vlan instead of doubletag to disable VLAN mode)
            Attribute 3 (none): apply (Activate changes in the hardware)
            Attribute 4 (none): reset (Reset the switch)
            Attribute 1 (ports): ports (VLAN port mapping)
            Attribute 1 (int): disable (Port state (1:disabled))
            Attribute 2 (int): doubletag (Double tagging for incoming vlan packets (1:enabled))
            Attribute 3 (int): untag (Untag (1:strip outgoing vlan tag))
            Attribute 4 (int): led (LED mode (0:link, 1:100m, 2:duplex, 3:activity, 4:collision, 5:linkact, 6:duplcoll, 7:10mact, 8:1)
            Attribute 5 (int): lan (HW port group (0:wan, 1:lan))
            Attribute 6 (int): recv_bad (Receive bad packet counter)
            Attribute 7 (int): recv_good (Receive good packet counter)
            Attribute 8 (int): pvid (Primary VLAN ID)
            Attribute 9 (string): link (Get port link information)
    swconfig dev rtl8366rb help
    switch1: rtl8366rb(RTL8366RB), ports: 6 (cpu @ 5), vlans: 4096
            Attribute 1 (int): enable_learning (Enable learning, enable aging)
            Attribute 2 (int): enable_vlan (Enable VLAN mode)
            Attribute 3 (int): enable_vlan4k (Enable VLAN 4K mode)
            Attribute 4 (none): reset_mibs (Reset all MIB counters)
            Attribute 5 (int): blinkrate (Get/Set LED blinking rate (0 = 43ms, 1 = 84ms, 2 = 120ms, 3 = 170ms, 4 = 340ms, 5 = 670ms))
            Attribute 6 (int): enable_qos (Enable QOS)
            Attribute 7 (none): apply (Activate changes in the hardware)
            Attribute 8 (none): reset (Reset the switch)
            Attribute 1 (string): info (Get vlan information)
            Attribute 2 (int): fid (Get/Set vlan FID)
            Attribute 3 (ports): ports (VLAN port mapping)
            Attribute 1 (none): reset_mib (Reset single port MIB counters)
            Attribute 2 (string): mib (Get MIB counters for port)
            Attribute 3 (int): led (Get/Set port group (0 - 3) led mode (0 - 15))
            Attribute 4 (int): disable (Get/Set port state (enabled or disabled))
            Attribute 5 (int): rate_in (Get/Set port ingress (incoming) bandwidth limit in kbps)
            Attribute 6 (int): rate_out (Get/Set port egress (outgoing) bandwidth limit in kbps)
            Attribute 7 (int): pvid (Primary VLAN ID)
            Attribute 8 (string): link (Get port link information)


Note: Make sure to apply any changes made previously with the "set" command.

  • LEDs:
    swconfig dev rtl8366s port 0 set led 2
    wconfig dev rtl8366rb set apply
  • Disable VLANs:
    swconfig dev switch0 set enable_vlan 0
    swconfig dev switch0 set apply



Back to top

doc/techref/swconfig.txt · Last modified: 2014/03/16 16:55 by gnyers