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:guide-user:network:ipv4:configuration [2023/05/02 23:19] – [Custom MAC address on WAN] add vgaetera | docs:guide-user:network:ipv4:configuration [2023/10/08 04:27] – optimize vgaetera | ||
|---|---|---|---|
| Line 2: | Line 2: | ||
| 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. | ||
| <code bash> | <code bash> | ||
| - | # uci show network | ||
| - | ... | ||
| - | network.wan=interface | ||
| - | network.wan.device=' | ||
| - | network.wan.proto=' | ||
| - | ... | ||
| - | </ | ||
| - | |||
| - | <code bash># cat / | ||
| - | ... | ||
| config interface ' | config interface ' | ||
| option device ' | option device ' | ||
| option proto ' | option proto ' | ||
| - | ... | ||
| </ | </ | ||
| Line 32: | Line 21: | ||
| | '' | | '' | ||
| | '' | | '' | ||
| - | | '' | + | | '' |
| | '' | | '' | ||
| ===== Protocol " | ===== Protocol " | ||
| ^ Name ^ Type ^ Required ^ Default ^ Description ^ | ^ Name ^ Type ^ Required ^ Default ^ Description ^ | ||
| - | | ''< | ||
| | '' | | '' | ||
| | '' | | '' | ||
| - | | '' | + | | '' |
| - | | '' | + | | '' |
| - | | '' | + | | '' |
| | '' | | '' | ||
| | '' | | '' | ||
| Line 54: | Line 42: | ||
| | '' | | '' | ||
| - | :!: These parameters are handled partially by netifd (in '' | + | :!: These parameters are handled partially by netifd (in '' |
| + | Note prior to commit 3cee6f3f24 the norelease option was known as release and had the opposite sense. | ||
| 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/ |
| + | For example: | ||
| <code bash> | <code bash> | ||
| Line 72: | Line 62: | ||
| </ | </ | ||
| - | 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: | + | |
| <code bash> | <code bash> | ||
| Line 90: | Line 78: | ||
| 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 | + | ===== Downstream configuration for LAN interfaces |
| For a downlink with IPv4 connectivity you can just use the default configuration, | For a downlink with IPv4 connectivity you can just use the default configuration, | ||
| <code bash> | <code bash> | ||
| - | # uci show network | ||
| - | network.lan=interface | ||
| - | network.lan.device=' | ||
| - | network.lan.proto=' | ||
| - | network.lan.netmask=' | ||
| - | network.lan.ip6assign=' | ||
| - | network.lan.ipaddr=' | ||
| - | ... | ||
| - | </ | ||
| - | |||
| - | <code bash> | ||
| - | # / | ||
| config interface ' | config interface ' | ||
| option device ' | option device ' | ||
| Line 118: | Line 94: | ||
| list ports ' | list ports ' | ||
| list ports ' | list ports ' | ||
| - | ... | ||
| - | </ | ||
| - | |||
| - | ===== Examples ===== | ||
| - | Below are a few examples for special, non-standard interface configurations. | ||
| - | |||
| - | ==== Bridge without IP ==== | ||
| - | <code bash> | ||
| - | config interface ' | ||
| - | option proto ' | ||
| - | option device | ||
| - | option auto ' | ||
| - | |||
| - | config device ' | ||
| - | option name ' | ||
| - | option type ' | ||
| - | list ports ' | ||
| - | list ports ' | ||
| - | </ | ||
| - | |||
| - | ==== DHCP without default gateway ==== | ||
| - | <code bash> | ||
| - | config interface ' | ||
| - | option proto ' | ||
| - | option device | ||
| - | option defaultroute' | ||
| - | </ | ||
| - | |||
| - | ==== DHCP and IPv6 ==== | ||
| - | <code bash> | ||
| - | config interface ' | ||
| - | option proto ' | ||
| - | option device | ||
| - | |||
| - | config alias | ||
| - | option interface ' | ||
| - | option proto ' | ||
| - | option ip6addr | ||
| - | </ | ||
| - | |||
| - | ==== Static IP configuration with multiple DNS servers ==== | ||
| - | <code bash> | ||
| - | config interface ' | ||
| - | option proto ' | ||
| - | option device | ||
| - | option ipaddr | ||
| - | option netmask | ||
| - | list | ||
| - | list | ||
| - | </ | ||
| - | |||
| - | :!: The last DNS listed will be the first one to be chosen for the name resolution. | ||
| - | |||
| - | :!: Restart the service to apply the new DNS configuration: | ||
| - | |||
| - | ==== 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 route | ||
| - | option interface ' | ||
| - | option target | ||
| - | option netmask | ||
| - | option gateway | ||
| - | option metric | ||
| - | </ | ||
| - | |||
| - | ===== Multiple IP addresses ===== | ||
| - | Assigning multiple IP addresses to the same interface: | ||
| - | |||
| - | <code bash> | ||
| - | config interface ' | ||
| - | option device ' | ||
| - | list ipaddr ' | ||
| - | list ipaddr ' | ||
| - | list ip6addr ' | ||
| - | list ip6addr ' | ||
| - | </ | ||
| - | |||
| - | Specifying multiple interfaces sharing the same device: | ||
| - | |||
| - | <code bash> | ||
| - | config interface ' | ||
| - | option device ' | ||
| - | option ipaddr ' | ||
| - | option netmask ' | ||
| - | option ip6addr ' | ||
| - | |||
| - | config interface ' | ||
| - | option device ' | ||
| - | option ipaddr ' | ||
| - | option netmask ' | ||
| - | option ip6addr ' | ||
| - | </ | ||
| - | |||
| - | Originally posted at [[https:// | ||
| - | |||
| - | |||
| - | ===== Custom MAC address on WAN ===== | ||
| - | <code bash> | ||
| - | uci -q delete network.wan_dev | ||
| - | uci set network.wan_dev=" | ||
| - | uci set network.wan_dev.name=" | ||
| - | uci set network.wan_dev.macaddr=" | ||
| - | commit network | ||
| - | / | ||
| </ | </ | ||