ETHERSWITCHCFG(8)
π 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:
-fcontrol file β specifies theetherswitch(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,-vis the "give me everything" flag π
π config
the config command gives you access to global switch configuration parameters. it supports the following commands:
vlan_modemode β 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:
pvidnumber β sets the default port VID that is used to process incoming frames that are not tagged.mediamediaspec β specifies the physical media configuration to be configured for a port.mediaoptmediaoption β specifies a list of media options for a port. seeifconfig(8)for details onmediaandmediaopt, iykyk.lednumber style β sets the display style for a given LED. the available styles are:default(usually flash on activity),on,off, andblink. 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:
vlanVID β 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.membersport,... β 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 bytto indicate that frames on this port are tagged. the littletis 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
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2011-2012 Stefan Bethke
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms