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