IPv4 examples

Below are a few examples for special, non-standard interface configurations.

config interface 'example'
	option proto   'none'
	option device  'br-lan'
	option auto    '1'
 
config device 'example_dev'
	option name 'br-lan'
	option type 'bridge'
	list ports 'eth0'
	list ports 'eth1'
config interface 'example'
	option proto   'dhcp'
	option device  'eth0'
	option defaultroute' '0'
config interface 'example'
	option proto     'dhcp'
	option device    'eth0'
 
config alias
	option interface 'example'
	option proto     'static'
	option ip6addr   '2001:0DB8:100:F00:BA3::1'
config interface 'example'
	option proto     'static'
	option device    'eth0'
	option ipaddr    '192.168.1.200'
	option netmask   '255.255.255.0'
	list   dns       '192.168.1.1'
	list   dns       '192.168.10.1'

:!: 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: service dnsmasq restart

config interface 'example'
	option proto     'static'
	option device    'eth0'
	option ipaddr    '192.168.1.200'
	option netmask   '255.255.255.0'
	option dns       '192.168.1.1'
 
config route
	option interface 'example'
	option target    '0.0.0.0'
	option netmask   '0.0.0.0'
	option gateway   '192.168.1.1'
	option metric    '100'

Assigning multiple IP addresses to the interface foo.

config interface 'foo'
	option device 'eth1'
	list ipaddr '10.8.0.1/24'
	list ipaddr '10.9.0.1/24'
	list ip6addr 'fdca:abcd::1/64'
	list ip6addr 'fdca:cdef::1/64'

See also: Aliases

Configure a custom MAC address for device eth0.

config device
	option name 'eth0'
	option macaddr '00:11:22:33:44:55'
This website uses cookies. By using the website, you agree with storing cookies on your computer. Also you acknowledge that you have read and understand our Privacy Policy. If you do not agree leave the website.More information about cookies
  • Last modified: 2023/10/11 01:20
  • by vgaetera