1 .\" Copyright (c) 2011-2012 Stefan Bethke.
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 .Nd configure a built-in Ethernet switch
33 .Op Fl "f control file"
36 .Op Fl "f control file"
40 .Op Fl "f control file"
42 .Ar phy.register[=value]
44 .Op Fl "f control file"
46 .Ar [flags] command parameter
48 .Op Fl "f control file"
52 .Op Fl "f control file"
58 utility is used to configure an Ethernet switch built into the system.
60 accepts a number of options:
62 .Bl -tag -width ".Fl f" -compact
63 .It Fl "f control file"
66 control file that represents the switch to be configured.
68 .Pa /dev/etherswitch0 .
70 When reporting port information, also list available media options for
73 Produce more verbose output.
74 Without this flag, lines that represent inactive or empty configuration
78 The config command provides access to global switch configuration
80 It support the following commands:
82 .Bl -tag -width ".Cm vlan_mode mode" -compact
83 .It Cm vlan_mode Ar mode
84 Sets the switch VLAN mode (depends on the hardware).
87 The phy command provides access to the registers of the PHYs attached
88 to or integrated into the switch controller.
89 PHY registers are specified as phy.register,
92 is usually the port number, and
94 is the register number.
95 Both can be provided as decimal, octal or hexadecimal numbers in any of the formats
98 To set the register value, use the form instance.register=value.
100 The port command selects one of the ports of the switch.
101 It supports the following commands:
103 .Bl -tag -width ".Ar pvid number" -compact
104 .It Cm pvid Ar number
105 Sets the default port VID that is used to process incoming frames that are not tagged.
106 .It Cm media Ar mediaspec
107 Specifies the physical media configuration to be configured for a port.
108 .It Cm mediaopt Ar mediaoption
109 Specifies a list of media options for a port.
116 .It Cm led Ar number style
117 Sets the display style for a given LED.
118 Available styles are:
120 (usually flash on activity),
125 Not all switches will support all styles.
128 And the following flags (please note that not all flags
129 are supported by all switch drivers):
131 .Bl -tag -width ".Fl addtag" -compact
133 Add VLAN tag to each packet sent by the port.
135 Disable the add VLAN tag option.
137 Strip the VLAN tags from the packets sent by the port.
139 Disable the strip VLAN tag option.
140 .It Cm striptagingress
141 Strip the VLAN tags from the packets received by the port.
142 .It Fl striptagingress
143 Disable the strip VLAN tag on ingress option.
145 This options makes the switch port lock on the first MAC address it sees.
146 After that, usually you need to reset the switch to learn different
149 Disable the first lock option.
150 Note that sometimes you need to reset the
151 switch to really disable this option.
153 Drop packets with a VLAN tag.
155 Disable the drop tagged packets option.
157 Drop packets without a VLAN tag.
159 Disable the drop untagged packets option.
161 Enable QinQ for the port.
163 Disable QinQ for the port.
165 Enable the ingress filter on the port.
167 Disable the ingress filter.
170 The reg command provides access to the registers of the switch controller.
172 The vlangroup command selects one of the VLAN groups for configuration.
173 It supports the following commands:
175 .Bl -tag -width ".Cm members" -compact
177 Sets the VLAN ID (802.1q VID) for this VLAN group.
178 Frames transmitted on tagged member ports of this group will be tagged
180 Incoming frames carrying this tag will be forwarded according to the
181 configuration of this VLAN group.
182 .It Cm members Ar port,...
183 Configures which ports are to be a member of this VLAN group.
184 The port numbers are given as a comma-separated list.
185 Each port can optionally be followed by
187 to indicate that frames on this port are tagged.
190 .Bl -tag -width /dev/etherswitch? -compact
191 .It Pa /dev/etherswitch?
192 Control file for the Ethernet switch driver.
195 Configure VLAN group 1 with a VID of 2 and make ports 0 and 5 its members
196 while excluding all other ports.
197 Port 5 will send and receive tagged frames while port 0 will be untagged.
198 Incoming untagged frames on port 0 are assigned to vlangroup1.
200 .Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 pvid 2