1.\" $FreeBSD$ 2.Dd December 15, 2011 3.Dt ETHERSWITCHCFG 8 4.Os 5.Sh NAME 6.Nm etherswitchcfg 7.Nd configure a built-in Ethernet switch 8.Sh SYNOPSIS 9.Nm 10.Op Fl "f control file" 11.Ar info 12.Nm 13.Op Fl "f control file" 14.Ar config 15.Ar command parameter 16.Nm 17.Op Fl "f control file" 18.Ar phy 19.Ar phy.register[=value] 20.Nm 21.Op Fl "f control file" 22.Ar port%d 23.Ar [flags] command parameter 24.Nm 25.Op Fl "f control file" 26.Ar reg 27.Ar register[=value] 28.Nm 29.Op Fl "f control file" 30.Ar vlangroup%d 31.Ar command parameter 32.Sh DESCRIPTION 33The 34.Nm 35utility is used to configure an Ethernet switch built into the system. 36.Nm 37accepts a number of options: 38.Bl -tag -width ".Fl f" -compact 39.It Fl "f control file" 40Specifies the 41.Xr etherswitch 4 42control file that represents the switch to be configured. 43It defaults to 44.Li /dev/etherswitch0 . 45.It Fl m 46When reporting port information, also list available media options for 47that port. 48.It Fl v 49Produce more verbose output. 50Without this flag, lines that represent inactive or empty configuration 51options are omitted. 52.El 53.Ss config 54The config command provides access to global switch configuration 55parameters. 56It support the following commands: 57.Bl -tag -width ".Ar vlan_mode mode" -compact 58.It Ar vlan_mode mode 59Sets the switch VLAN mode (depends on the hardware). 60.El 61.Ss phy 62The phy command provides access to the registers of the PHYs attached 63to or integrated into the switch controller. 64PHY registers are specified as phy.register, 65where 66.Ar phy 67is usually the port number, and 68.Ar register 69is the register number. 70Both can be provided as decimal, octal or hexadecimal numbers in any of the formats 71understood by 72.Xr strtol 4 . 73To set the register value, use the form instance.register=value. 74.Ss port 75The port command selects one of the ports of the switch. 76It supports the following commands: 77.Bl -tag -width ".Ar pvid number" -compact 78.It Ar pvid number 79Sets the default port VID that is used to process incoming frames that are not tagged. 80.It Ar media mediaspec 81Specifies the physical media configuration to be configured for a port. 82.It Ar mediaopt mediaoption 83Specifies a list of media options for a port. 84See 85.Xr ifconfig 8 86for details on 87.Ar media 88and 89.Ar mediaopt . 90.El 91And the following flags (please note that not all flags 92are supporterd by all switch drivers): 93.Bl -tag -width ".Ar addtag" -compact 94.It Ar addtag 95Add VLAN tag to each packet sent by the port. 96.It Ar -addtag 97Disable the add VLAN tag option. 98.It Ar striptag 99Strip the VLAN tags from the packets sent by the port. 100.It Ar -striptag 101Disable the strip VLAN tag option. 102.It Ar firstlock 103This options makes the switch port lock on the first MAC address it seems. 104After that, usually you need to reset the switch to learn different 105MAC addresses. 106.It Ar -firstlock 107Disable the first lock option. 108Note that sometimes you need to reset the 109switch to really disable this option. 110.It Ar dropuntagged 111Drop packets without a VLAN tag. 112.It Ar -dropuntagged 113Disable the drop untagged packets option. 114.It Ar doubletag 115Enable QinQ for the port. 116.It Ar -doubletag 117Disable QinQ for the port. 118.It Ar ingress 119Enable the ingress filter on the port. 120.It Ar -ingress 121Disable the ingress filter. 122.El 123.Ss reg 124The reg command provides access to the registers of the switch controller. 125.Ss vlangroup 126The vlangroup command selects one of the VLAN groups for configuration. 127It supports the following commands: 128.Bl -tag -width ".Ar vlangroup" -compact 129.It Ar vlan VID 130Sets the VLAN ID (802.1q VID) for this VLAN group. 131Frames transmitted on tagged member ports of this group will be tagged 132with this VID. 133Incoming frames carrying this tag will be forwarded according to the 134configuration of this VLAN group. 135.It Ar members port,... 136Configures which ports are to be a member of this VLAN group. 137The port numbers are given as a comma-separated list. 138Each port can optionally be followed by 139.Dq t 140to indicate that frames on this port are tagged. 141.El 142.Sh FILES 143.Bl -tag -width /dev/etherswitch? -compact 144.It Pa /dev/etherswitch? 145Control file for the ethernet switch driver. 146.El 147.Sh EXAMPLES 148Configure VLAN group 1 with a VID of 2 and makes ports 0 and 5 members, 149while excluding all other ports. 150Port 5 will send and receive tagged frames, while port 0 will be untagged. 151Incoming untagged frames on port 0 are assigned to vlangroup1. 152.Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 pvid 2 153.Sh SEE ALSO 154.Xr etherswitch 4 155.Sh HISTORY 156.Nm 157first appeared in 158.Fx 10.0 . 159.Sh AUTHORS 160.An Stefan Bethke 161