add switch config info to network documentation
[openwrt/staging/dedeckeh.git] / openwrt / docs / network.txt
1 Network configuration in buildroot-ng
4 The network configuration in buildroot-ng is stored in /etc/config/network
5 and is divided into interface configurations.
6 Each interface configuration either refers directly to an ethernet/wifi
7 interface (eth0, wl0, ..) or to a bridge containing multiple interfaces.
8 It looks like this:
10 config interface "lan"
11 option ifname "eth0"
12 option proto "static"
13 option ipaddr ""
14 option netmask ""
15 option gateway ""
16 option dns ""
18 "ifname" specifies the Linux interface name.
19 If you want to use bridging on one or more interfaces, set "ifname" to a list
20 of interfaces and add:
21 option type "bridge"
23 It is possible to use VLAN tagging on an interface simply by adding the VLAN IDs
24 to it, e.g. "eth0.1". These can be nested as well.
26 This sets up a simple static configuration for eth0. "proto" specifies the
27 'protocol' used for the interface. The default image usually provides 'none'
28 'static', 'dhcp' and 'pppoe'. Others can be added by installing additional
29 packages.
31 When using the 'static' method like in the example, the options "ipaddr" and
32 "netmask" are mandatory, while "gateway" and "dns" are optional.
33 DHCP currently only accepts "ipaddr" (IP address to request from the server)
34 and "hostname" (client hostname identify as) - both are optional.
36 PPP based protocols (pppoe, pptp, ...) accept these options:
37 username:
38 The PPP username (usually with PAP authentication)
39 password:
40 The PPP password
41 keepalive:
42 Ping the PPP server (using LCP). The value of this option
43 specifies the maximum number of failed pings before reconnecting.
44 The ping interval defaults to 5, but can be changed by appending
45 ",<interval>" to the keepalive value
46 demand:
47 Use Dial on Demand (value specifies the maximum idle time)
49 (pptp)
50 server: The remote pptp server IP
52 For all protocol types, you can also specify the MTU by using the "mtu" option.
57 Setting up the switch (currently broadcom only)
60 The switch configuration is set by adding a 'switch' config section.
61 Example:
63 config switch eth0
64 option vlan0 "1 2 3 4 5*"
65 option vlan1 "0 5"
67 On Broadcom hardware the section name needs to be eth0, as the switch driver
68 does not detect the switch on any other physical device.
69 Every vlan option needs to have the name vlan<n> where <n> is the VLAN number
70 as used in the switch driver.
71 As value it takes a list of ports with these optional suffixes:
73 '*': Set the default VLAN (PVID) of the Port to the current VLAN
74 'u': Force the port to be untagged
75 't': Force the port to be tagged
77 The CPU port defaults to tagged, all other ports to untagged.
78 On Broadcom hardware the CPU port is always 5. The other ports may vary with
79 different hardware.