Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| docs:user-guide:base-system:network:basic-ipv4-configuration [2018/02/17 16:11] – bobafetthotmail | docs:guide-user:network:ipv4:start [2021/09/09 20:47] – ==> 21.02 migration / use the previous page version for 19.07 <== vgaetera | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ===== IPv4 ==== | + | ====== IPv4 ====== |
| Due to obvious reasons, IPv4 is fully supported in default firmware. | Due to obvious reasons, IPv4 is fully supported in default firmware. | ||
| - | ==== Upstream configuration for WAN-Interfaces ==== | + | ===== Upstream configuration for WAN-Interfaces |
| The following sections describe the configuration of IPv4 connections to your ISP or an upstream router. | The following sections describe the configuration of IPv4 connections to your ISP or an upstream router. | ||
| For an uplink with native IPv4 connectivity you can just use the default configuration. | For an uplink with native IPv4 connectivity you can just use the default configuration. | ||
| - | < | + | < |
| + | # uci show network | ||
| ... | ... | ||
| network.wan=interface | network.wan=interface | ||
| - | network.wan.ifname=' | + | network.wan.device=' |
| network.wan.proto=' | network.wan.proto=' | ||
| - | ...</ | + | ... |
| + | </ | ||
| - | < | + | < |
| ... | ... | ||
| config interface ' | config interface ' | ||
| - | | + | option |
| - | option proto ' | + | option proto ' |
| - | ...</ | + | ... |
| + | </ | ||
| - | === Protocol " | + | ===== Protocol " |
| ^ Name ^ Type ^ Required ^ Default ^ Description ^ | ^ Name ^ Type ^ Required ^ Default ^ Description ^ | ||
| | '' | | '' | ||
| Line 32: | Line 34: | ||
| | '' | | '' | ||
| - | === Protocol " | + | ===== Protocol " |
| ^ Name ^ Type ^ Required ^ Default ^ Description ^ | ^ Name ^ Type ^ Required ^ Default ^ Description ^ | ||
| | ''< | | ''< | ||
| Line 48: | Line 50: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| + | | '' | ||
| | '' | | '' | ||
| - | :!: These parameters are handled partially by netifd (in '' | + | :!: These parameters are handled partially by netifd (in '' |
| FIXME Outdated information, | FIXME Outdated information, | ||
| - | :!: If an interface is configured as dhcp client, the default route received by dhcp will be the only one listed and will remove other default route/ | + | :!: If an interface is configured as dhcp client, the default route received by dhcp will be the only one listed and will remove other default route/ |
| - | < | + | |
| - | config interface wan | + | < |
| - | option | + | config interface |
| - | option proto static | + | option |
| - | ..other options.. | + | option proto 'static' |
| + | ... | ||
| | | ||
| - | config interface wan2 | + | config interface |
| - | option | + | option |
| - | option proto dhcp | + | option proto 'dhcp' |
| - | ..other options.. | + | ... |
| </ | </ | ||
| + | |||
| The interface with dhcp comes after (because eth1 comes after eth0 in a lexicografical order) | The interface with dhcp comes after (because eth1 comes after eth0 in a lexicografical order) | ||
| and will overwrite the default routes set up by the interface " | and will overwrite the default routes set up by the interface " | ||
| If we have: | If we have: | ||
| - | < | + | |
| - | config interface wan | + | < |
| - | option | + | config interface |
| - | option proto dhcp | + | option |
| - | ..other options.. | + | option proto 'dhcp' |
| + | ... | ||
| | | ||
| - | config interface wan2 | + | config interface |
| - | option | + | option |
| - | option proto static | + | option proto 'static' |
| - | ..other options.. | + | ... |
| </ | </ | ||
| + | |||
| Both default routes set up by wan and wan2 will appear in the routing table. | Both default routes set up by wan and wan2 will appear in the routing table. | ||
| + | ===== Downstream configuration for LAN-Interfaces ===== | ||
| + | For a downlink with IPv4 connectivity you can just use the default configuration, | ||
| - | ==== Downstream configuration for LAN-Interfaces ==== | + | < |
| - | For a downlink with IPv4 connectivity you can just use the default configuration, | + | # uci show network |
| - | + | ||
| - | < | + | |
| - | ... | + | |
| network.lan=interface | network.lan=interface | ||
| - | network.lan.type='bridge' | + | network.lan.device='br-lan' |
| - | network.lan.ifname=' | + | |
| network.lan.proto=' | network.lan.proto=' | ||
| network.lan.netmask=' | network.lan.netmask=' | ||
| network.lan.ip6assign=' | network.lan.ip6assign=' | ||
| network.lan.ipaddr=' | network.lan.ipaddr=' | ||
| - | ...</ | ||
| - | |||
| - | < | ||
| ... | ... | ||
| + | </ | ||
| + | |||
| + | <code bash> | ||
| + | # / | ||
| config interface ' | config interface ' | ||
| - | | + | option |
| - | | + | option proto ' |
| - | | + | option netmask ' |
| - | option netmask ' | + | option ip6assign ' |
| - | option ip6assign ' | + | option ipaddr ' |
| - | option ipaddr ' | + | |
| - | ...</ | + | config device ' |
| + | option name ' | ||
| + | option type ' | ||
| + | list ports ' | ||
| + | list ports ' | ||
| + | ... | ||
| + | </ | ||
| ===== Examples ===== | ===== Examples ===== | ||
| - | |||
| Below are a few examples for special, non-standard interface configurations. | Below are a few examples for special, non-standard interface configurations. | ||
| ==== Bridge without IP ==== | ==== Bridge without IP ==== | ||
| + | <code bash> | ||
| + | config interface ' | ||
| + | option proto ' | ||
| + | option device | ||
| + | option auto ' | ||
| - | < | + | config |
| - | option | + | option name 'br-lan' |
| - | | + | option type ' |
| - | | + | list ports 'eth0' |
| - | | + | list ports ' |
| + | </ | ||
| ==== DHCP without default gateway ==== | ==== DHCP without default gateway ==== | ||
| - | + | < | |
| - | < | + | config interface ' |
| - | option | + | option proto ' |
| - | option | + | option |
| - | option | + | option defaultroute' |
| </ | </ | ||
| ==== DHCP and IPv6 ==== | ==== DHCP and IPv6 ==== | ||
| + | <code bash> | ||
| + | config interface ' | ||
| + | option proto ' | ||
| + | option device | ||
| - | < | + | config alias |
| - | option ' | + | option interface ' |
| - | option ' | + | option proto ' |
| - | + | option ip6addr | |
| - | config 'alias' | + | </ |
| - | option | + | |
| - | option | + | |
| - | option | + | |
| - | ==== Static IP configuration with multiple | + | ==== Static IP configuration with multiple |
| - | < | + | < |
| - | option | + | config interface ' |
| - | option | + | option proto ' |
| - | option | + | option |
| - | option | + | option ipaddr |
| - | list 'dns' | + | option netmask |
| - | list 'dns' | + | list |
| + | list | ||
| </ | </ | ||
| - | :!: the last dns listed will be the first one to be chosen for the name resolution. | ||
| - | :!: LEDE will use the new dns configured only after a reboot or a '' | + | :!: The last DNS listed |
| + | |||
| + | :!: Restart the service to apply the new DNS configuration: | ||
| ==== Static IP configuration and default gateway with non-zero metric ==== | ==== Static IP configuration and default gateway with non-zero metric ==== | ||
| + | <code bash> | ||
| + | config interface ' | ||
| + | option proto' | ||
| + | option device' | ||
| + | option ipaddr' | ||
| + | option netmask' | ||
| + | option dns' | ||
| - | < | + | config |
| - | option | + | option |
| - | option ' | + | option |
| - | option ' | + | option netmask |
| - | option | + | option |
| - | option | + | option metric |
| + | </ | ||
| - | config ' | ||
| - | option ' | ||
| - | option ' | ||
| - | option ' | ||
| - | option ' | ||
| - | option ' | ||
| - | | ||
| ===== Multiple IP addresses ===== | ===== Multiple IP addresses ===== | ||
| - | Assigning multiple | + | Assigning multiple |
| - | < | + | |
| - | config interface foo | + | < |
| - | option | + | config interface |
| - | list ipaddr 10.8.0.1/ | + | option |
| - | list ipaddr 10.9.0.1/ | + | list ipaddr |
| - | list ip6addr fdca: | + | list ipaddr |
| - | list ip6addr fdca: | + | list ip6addr |
| + | list ip6addr | ||
| </ | </ | ||
| + | |||
| Specifying multiple interfaces sharing the same device: | Specifying multiple interfaces sharing the same device: | ||
| - | < | ||
| - | config interface foo | ||
| - | option ifname eth1 | ||
| - | option ipaddr 10.8.0.1 | ||
| - | option netmask 255.255.255.0 | ||
| - | option ip6addr fdca: | ||
| - | config interface foo2 | + | <code bash> |
| - | option | + | config interface ' |
| - | option ipaddr 10.9.0.1 | + | option device ' |
| - | option netmask 255.255.255.0 | + | option ipaddr ' |
| - | option ip6addr fdca: | + | option netmask ' |
| + | option ip6addr ' | ||
| + | |||
| + | config interface | ||
| + | option | ||
| + | option ipaddr | ||
| + | option netmask | ||
| + | option ip6addr | ||
| </ | </ | ||
| + | |||
| Originally posted at [[https:// | Originally posted at [[https:// | ||
| + | |||