ETHERSWITCHCFG(8)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’… ETHERSWITCHCFG β€” like, the whole manual, bestie

okay so this is etherswitchcfg(8), straight out of the System Manager's Manual, and it's literally the tool you use to configure a built-in Ethernet switch. it's giving "network admin but make it cute." let's get into it 🫢


✨ NAME ✨

etherswitchcfg β€” configure a built-in Ethernet switch. yes bestie, the switch that's inside the system. iconic behavior only πŸ”₯


🌸 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] vlangroup%d command parameter

look at all those little modes. pick your main character, babes ✨


πŸ’– DESCRIPTION πŸ’–

so the etherswitchcfg utility is used to configure an Ethernet switch built into the system. that's the whole vibe. etherswitchcfg accepts a number of options:

  • -f control file β€” specifies the etherswitch(4) control file that represents the switch you want to configure. it defaults to /dev/etherswitch0. defaults are so comfy ngl πŸ’œ
  • -m β€” when reporting port information, also list the available media options for that port. more info = more slay πŸ‘‘
  • -v β€” produce more verbose output. without this flag, lines that represent inactive or empty configuration options are omitted. so like, -v is the "give me everything" flag πŸ™ˆ

πŸŽ€ config

the config command gives you access to global switch configuration parameters. it supports the following commands:

  • vlan_mode mode β€” sets the switch VLAN mode (this one depends on the hardware, so no promises, bestie).

πŸ¦‹ phy

the phy command gives you 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 given as decimal, octal or hexadecimal numbers, in any of the formats understood by strtol(3) β€” go off, number formats πŸ’… 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) for details on media and mediaopt, iykyk.
  • led number style β€” sets the display style for a given LED. the available styles are: default (usually flash on activity), on, off, and blink. not all switches will support all styles β€” read the room, hardware 😭

and then there's the following flags. please note that not all flags are supported by all switch drivers β€” this is the fine print, do not skip it, fr fr:

  • 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 option 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. it's giving "commitment issues but make it hardware" πŸ’€
  • -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.

🌈 reg

the reg command gives you access to the registers of the switch controller. short and sweet, periodt.

πŸ“ 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. the little t is doing so much work, obsessed πŸŽ€

🧚 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

look at her. one line. running the whole VLAN. main character energy fr πŸ’…βœ¨


πŸ’œ SEE ALSO πŸ’œ


🌸 HISTORY 🌸

etherswitchcfg first appeared in FreeBSD 10.0. a legend since day one, no cap 🫢


πŸŽ€ AUTHORS πŸŽ€

Stefan Bethke


okay that's the whole page, nothing skipped, every flag accounted for πŸ˜ŒπŸ’– this lil gem is from the Debian build of the manual page, dated June 23, 2021 β€” so like, go configure your switch, bestie, and remember: not all flags are supported by all switch drivers, and that's the vibe check. bye cutie πŸ¦‹βœ¨πŸŒˆ

πŸ“¦ where this page comes from