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/10/01 01:03] – update vgaetera | docs:guide-user:network:ipv4:configuration [2023/10/08 04:27] – optimize vgaetera | ||
|---|---|---|---|
| Line 8: | Line 8: | ||
| <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 93: | Line 82: | ||
| <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 117: | 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 ==== | ||
| - | <code bash> | ||
| - | config device | ||
| - | option name ' | ||
| - | option macaddr ' | ||
| </ | </ | ||