1.\" $NetBSD: vlan.4,v 1.30 2008/11/15 21:37:12 bouyer 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 November 15, 2008 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 wm 4 140.It 141.Xr xi 4 142.El 143.Pp 144.Nm 145can be used with devices not supporting the 146.Tn IEEE 147802.1Q 148.Tn MTU , 149but then the 150.Tn MTU 151of the 152.Nm 153interface will be 4 bytes too small and will not interoperate 154properly with other 155.Tn IEEE 156802.1Q devices, unless the 157.Tn MTU 158of the other hosts on the 159.Tn VLAN 160are also lowered to match. 161.Sh EXAMPLES 162The following will create interface 163.Sy vlan0 164with VID six, on the 165.Tn Ethernet 166interface 167.Sy tlp0 : 168.Bd -literal -offset indent 169ifconfig vlan0 create 170ifconfig vlan0 vlan 6 vlanif tlp0 171.Ed 172.Pp 173After this set up, 174.Tn IP 175addresses (and/or other protocols) can be assigned to the 176.Sy vlan0 177interface. 178All other hosts on the 179.Tn Ethernet 180connected to 181.Sy tlp0 182which configure a 183.Tn VLAN 184and use VID six will see all traffic transmitted through 185.Sy vlan0 . 186.Pp 187The same 188.Tn VLAN 189can be created at system startup time 190by placing the following in 191.Pa /etc/ifconfig.vlan0 : 192.Bd -literal -offset indent 193create 194vlan 6 vlanif tlp0 195.Ed 196.Sh SEE ALSO 197.Xr ifconfig 8 198.Sh HISTORY 199The 200.Nm 201device first appeared in 202.Nx 1.5.1 , 203and was derived from a 204.Tn VLAN 205implementation that appeared in 206.Fx 207and 208.Ox . 209.Sh BUGS 210The 211.Nm 212interfaces do not currently inherit changes made to the physical 213interfaces' 214.Tn MTU . 215