1.\" $NetBSD: vlan.4,v 1.31 2010/12/16 18:29:47 wiz Exp $ 2.\" 3.\" Copyright (c) 2000 The NetBSD Foundation, Inc. 4.\" All rights reserved. 5.\" 6.\" This code is derived from software contributed to The NetBSD Foundation 7.\" by Jason R. Thorpe of Zembu Labs, Inc. 8.\" 9.\" Redistribution and use in source and binary forms, with or without 10.\" modification, are permitted provided that the following conditions 11.\" are met: 12.\" 1. Redistributions of source code must retain the above copyright 13.\" notice, this list of conditions and the following disclaimer. 14.\" 2. Redistributions in binary form must reproduce the above copyright 15.\" notice, this list of conditions and the following disclaimer in the 16.\" documentation and/or other materials provided with the distribution. 17.\" 18.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21.\" PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28.\" POSSIBILITY OF SUCH DAMAGE. 29.\" 30.Dd December 16, 2010 31.Dt VLAN 4 32.Os 33.Sh NAME 34.Nm vlan 35.Nd IEEE 802.1Q Virtual LAN network device 36.Sh SYNOPSIS 37.Cd "pseudo-device vlan" 38.Sh DESCRIPTION 39The 40.Nm 41interface provides support for 42.Tn IEEE 43802.1Q Virtual Local Area Networks 44.Pq Tn VLAN . 45This supports the 46trunking of more than one network on a single network interface. 47This is particularly useful on routers or on hosts which must be 48connected to many different networks through a single physical interface. 49.Pp 50To use a 51.Nm vlan 52interface, the administrator must first create the interface and then 53specify the VID 54.Po 55.Tn VLAN 56identifier, the first 12 bits from a 16-bit integer which 57distinguishes each 58.Tn VLAN 59from any others 60.Pc 61and physical interface associated with the 62.Tn VLAN . 63This can be done by using the 64.Xr ifconfig 8 65.Ic create , 66.Ic vlan , 67and 68.Ic vlanif 69subcommands from a shell command line or script. 70From within a C program, use the 71.Xr ioctl 2 72system call with the 73.Dv SIOCSIFCREATE 74and 75.Dv SIOCSIFVLAN 76arguments. 77.Pp 78To be compatible with other 79.Tn IEEE 80802.1Q devices, the 81.Nm 82interface supports a 1500 byte 83.Tn MTU , 84which means that the parent interface will have to handle packets 85that are 4 bytes larger than the original 86.Tn Ethernet 87standard. 88Drivers supporting this increased 89.Tn MTU 90are: 91.Pp 92.Bl -dash -compact 93.It 94drivers using the DP8390 core 95.Po 96such as 97.Xr ec 4 , 98.Xr ne 4 , 99.Xr we 4 , 100and possibly others 101.Pc 102.It 103.Xr bge 4 104.It 105.Xr bnx 4 106.It 107.Xr ea 4 108.It 109.Xr eb 4 110.It 111.Xr epic 4 112.It 113.Xr etherip 4 114.It 115.Xr ex 4 116.It 117.Xr fxp 4 118.It 119.Xr gem 4 120.It 121.Xr hme 4 122.It 123.Xr le 4 124.It 125.Xr sip 4 126.It 127.Xr ste 4 128.It 129.Xr stge 4 130.It 131.Xr ti 4 132.It 133.Xr tl 4 134.It 135.Xr tlp 4 136.It 137.Xr vge 4 138.It 139.Xr vr 4 140.It 141.Xr wm 4 142.It 143.Xr xi 4 144.El 145.Pp 146.Nm 147can be used with devices not supporting the 148.Tn IEEE 149802.1Q 150.Tn MTU , 151but then the 152.Tn MTU 153of the 154.Nm 155interface will be 4 bytes too small and will not interoperate 156properly with other 157.Tn IEEE 158802.1Q devices, unless the 159.Tn MTU 160of the other hosts on the 161.Tn VLAN 162are also lowered to match. 163.Sh EXAMPLES 164The following will create interface 165.Sy vlan0 166with VID six, on the 167.Tn Ethernet 168interface 169.Sy tlp0 : 170.Bd -literal -offset indent 171ifconfig vlan0 create 172ifconfig vlan0 vlan 6 vlanif tlp0 173.Ed 174.Pp 175After this set up, 176.Tn IP 177addresses (and/or other protocols) can be assigned to the 178.Sy vlan0 179interface. 180All other hosts on the 181.Tn Ethernet 182connected to 183.Sy tlp0 184which configure a 185.Tn VLAN 186and use VID six will see all traffic transmitted through 187.Sy vlan0 . 188.Pp 189The same 190.Tn VLAN 191can be created at system startup time 192by placing the following in 193.Pa /etc/ifconfig.vlan0 : 194.Bd -literal -offset indent 195create 196vlan 6 vlanif tlp0 197.Ed 198.Sh SEE ALSO 199.Xr ifconfig 8 200.Sh HISTORY 201The 202.Nm 203device first appeared in 204.Nx 1.5.1 , 205and was derived from a 206.Tn VLAN 207implementation that appeared in 208.Fx 209and 210.Ox . 211.Sh BUGS 212The 213.Nm 214interfaces do not currently inherit changes made to the physical 215interfaces' 216.Tn MTU . 217