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
32 .Nd configure a built-in Ethernet switch
35 .Op Fl "f control file"
38 .Op Fl "f control file"
42 .Op Fl "f control file"
44 .Ar phy.register[=value]
46 .Op Fl "f control file"
48 .Ar [flags] command parameter
50 .Op Fl "f control file"
54 .Op Fl "f control file"
60 utility is used to configure an Ethernet switch built into the system.
62 accepts a number of options:
64 .Bl -tag -width ".Fl f" -compact
65 .It Fl "f control file"
68 control file that represents the switch to be configured.
70 .Pa /dev/etherswitch0 .
72 When reporting port information, also list available media options for
75 Produce more verbose output.
76 Without this flag, lines that represent inactive or empty configuration
80 The config command provides access to global switch configuration
82 It support the following commands:
84 .Bl -tag -width ".Cm vlan_mode mode" -compact
85 .It Cm vlan_mode Ar mode
86 Sets the switch VLAN mode (depends on the hardware).
89 The phy command provides access to the registers of the PHYs attached
90 to or integrated into the switch controller.
91 PHY registers are specified as phy.register,
94 is usually the port number, and
96 is the register number.
97 Both can be provided as decimal, octal or hexadecimal numbers in any of the formats
100 To set the register value, use the form instance.register=value.
102 The port command selects one of the ports of the switch.
103 It supports the following commands:
105 .Bl -tag -width ".Ar pvid number" -compact
106 .It Cm pvid Ar number
107 Sets the default port VID that is used to process incoming frames that are not tagged.
108 .It Cm media Ar mediaspec
109 Specifies the physical media configuration to be configured for a port.
110 .It Cm mediaopt Ar mediaoption
111 Specifies a list of media options for a port.
118 .It Cm led Ar number style
119 Sets the display style for a given LED.
120 Available styles are:
122 (usually flash on activity),
127 Not all switches will support all styles.
130 And the following flags (please note that not all flags
131 are supported by all switch drivers):
133 .Bl -tag -width ".Fl addtag" -compact
135 Add VLAN tag to each packet sent by the port.
137 Disable the add VLAN tag option.
139 Strip the VLAN tags from the packets sent by the port.
141 Disable the strip VLAN tag option.
142 .It Cm striptagingress
143 Strip the VLAN tags from the packets received by the port.
144 .It Fl striptagingress
145 Disable the strip VLAN tag on ingress option.
147 This options makes the switch port lock on the first MAC address it sees.
148 After that, usually you need to reset the switch to learn different
151 Disable the first lock option.
152 Note that sometimes you need to reset the
153 switch to really disable this option.
155 Drop packets with a VLAN tag.
157 Disable the drop tagged packets option.
159 Drop packets without a VLAN tag.
161 Disable the drop untagged packets option.
163 Enable QinQ for the port.
165 Disable QinQ for the port.
167 Enable the ingress filter on the port.
169 Disable the ingress filter.
172 The reg command provides access to the registers of the switch controller.
174 The vlangroup command selects one of the VLAN groups for configuration.
175 It supports the following commands:
177 .Bl -tag -width ".Cm members" -compact
179 Sets the VLAN ID (802.1q VID) for this VLAN group.
180 Frames transmitted on tagged member ports of this group will be tagged
182 Incoming frames carrying this tag will be forwarded according to the
183 configuration of this VLAN group.
184 .It Cm members Ar port,...
185 Configures which ports are to be a member of this VLAN group.
186 The port numbers are given as a comma-separated list.
187 Each port can optionally be followed by
189 to indicate that frames on this port are tagged.
192 .Bl -tag -width /dev/etherswitch? -compact
193 .It Pa /dev/etherswitch?
194 Control file for the Ethernet switch driver.
197 Configure VLAN group 1 with a VID of 2 and make ports 0 and 5 its members
198 while excluding all other ports.
199 Port 5 will send and receive tagged frames while port 0 will be untagged.
200 Incoming untagged frames on port 0 are assigned to vlangroup1.
202 .Dl # etherswitchcfg vlangroup1 vlan 2 members 0,5t port0 pvid 2