---
name: "etherswitchcfg"
section: "8"
platform: "freebsd"
package: "base"
version: "16.0-CURRENT-20261027-61c70dc16a79"
release: "FreeBSD 16.0-CURRENT (2026-10-27)"
platforms: ["freebsd"]
url: "https://new.carta.tech/etherswitchcfg"
---

# etherswitchcfg(8)

configure a built-in Ethernet switch

## NAME

**etherswitchcfg** – configure a built-in Ethernet switch

## SYNOPSIS

**etherswitchcfg** \[**-f control file**\] **info**

**etherswitchcfg** \[**-f control file**\] **config** *command* *parameter*

**etherswitchcfg** \[**-f control file**\] **phy** *phy.register\[=value\]*

**etherswitchcfg** \[**-f control file**\] **port%d** *\[flags\]* *command* *parameter*

**etherswitchcfg** \[**-f control file**\] **reg** *register\[=value\]*

**etherswitchcfg** \[**-f control file**\] **atu** *command* \[*parameter*\]

**etherswitchcfg** \[**-f control file**\] **vlangroup%d** *command* *parameter*

## DESCRIPTION

The **etherswitchcfg** utility is used to configure an Ethernet switch built into the system. **etherswitchcfg** accepts a number of options:

- **-f control file**

  Specifies the [etherswitch(4)](/etherswitch/4.md) control file that represents the switch to be configured. It defaults to */dev/etherswitch0*.

- **-m**

  When reporting port information, also list available media options for that port.

- **-v**

  Produce more verbose output. Without this flag, lines that represent inactive or empty configuration options are omitted.

### config

The config command provides access to global switch configuration parameters. It support the following commands:

- **vlan\_mode** *mode*

  Sets the switch VLAN mode (depends on the hardware).

### phy

The phy command provides access to the registers of the PHYs attached to or integrated into the switch controller. PHY registers are specified as phy.register, where *phy* is usually the port number, and *register* is the register number. Both can be provided as decimal, octal or hexadecimal numbers in any of the formats understood by [strtol(3)](/strtol/3.md). To set the register value, use the form instance.register=value.

### port

The port command selects one of the ports of the switch. It supports the following commands:

- **pvid** *number*

  Sets the default port VID that is used to process incoming frames that are not tagged.

- **media** *mediaspec*

  Specifies the physical media configuration to be configured for a port.

- **mediaopt** *mediaoption*

  Specifies a list of media options for a port. See [ifconfig(8)](/ifconfig/8.md) for details on **media** and **mediaopt**.

- **led** *number* *style*

  Sets the display style for a given LED. Available styles are: **default** (usually flash on activity), **on**, **off**, and **blink**. Not all switches will support all styles.

And the following flags (please note that not all flags are supported by all switch drivers):

- **addtag**

  Add VLAN tag to each packet sent by the port.

- **-addtag**

  Disable the add VLAN tag option.

- **striptag**

  Strip the VLAN tags from the packets sent by the port.

- **-striptag**

  Disable the strip VLAN tag option.

- **striptagingress**

  Strip the VLAN tags from the packets received by the port.

- **-striptagingress**

  Disable the strip VLAN tag on ingress option.

- **firstlock**

  This options makes the switch port lock on the first MAC address it sees. After that, usually you need to reset the switch to learn different MAC addresses.

- **-firstlock**

  Disable the first lock option. Note that sometimes you need to reset the switch to really disable this option.

- **droptagged**

  Drop packets with a VLAN tag.

- **-droptagged**

  Disable the drop tagged packets option.

- **dropuntagged**

  Drop packets without a VLAN tag.

- **-dropuntagged**

  Disable the drop untagged packets option.

- **doubletag**

  Enable QinQ for the port.

- **-doubletag**

  Disable QinQ for the port.

- **ingress**

  Enable the ingress filter on the port.

- **-ingress**

  Disable the ingress filter.

### atu

The atu command provides access to the Address Translation Unit table of the switch, which maps MAC addresses to switch ports. It supports the following commands:

- **dump**

  Display the current ATU table entries. Each entry shows the MAC address and a bitmask of ports associated with it.

- **flush** **all**

  Remove all dynamic entries from the ATU table.

- **flush** **port** *number*

  Remove all dynamic ATU entries associated with port *number*.

### reg

The reg command provides access to the registers of the switch controller.

### vlangroup

The vlangroup command selects one of the VLAN groups for configuration. It supports the following commands:

- **vlan** *VID*

  Sets the VLAN ID (802.1q VID) for this VLAN group. Frames transmitted on tagged member ports of this group will be tagged with this VID. Incoming frames carrying this tag will be forwarded according to the configuration of this VLAN group.

- **members** *port,...*

  Configures which ports are to be a member of this VLAN group. The port numbers are given as a comma-separated list. Each port can optionally be followed by “t” to indicate that frames on this port are tagged.

## FILES

- */dev/etherswitch?*

  Control file for the Ethernet switch driver.

## EXAMPLES

Configure VLAN group 1 with a VID of 2 and make ports 0 and 5 its members while excluding all other ports. Port 5 will send and receive tagged frames while port 0 will be untagged. Incoming untagged frames on port 0 are assigned to vlangroup1.

```
# etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 pvid 2
```

## SEE ALSO

[etherswitch(4)](/etherswitch/4.md)

## HISTORY

**etherswitchcfg** first appeared in FreeBSD 10.0.

## AUTHORS

Stefan Bethke
