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