mirror of
https://github.com/iiab/iiab.git
synced 2025-03-09 15:40:17 +00:00
69 lines
2.5 KiB
Django/Jinja
69 lines
2.5 KiB
Django/Jinja
# This file describes the network interfaces available on your system
|
|
# and how to activate them. For more information, see interfaces(5).
|
|
|
|
source /etc/network/interfaces.d/*
|
|
|
|
# The loopback network interface
|
|
auto lo
|
|
iface lo inet loopback
|
|
|
|
# iiab_network_mode is {{ gui_desired_network_role }}
|
|
{% if discovered_wireless_iface != 'none' %}
|
|
# we always want the wireless to be configured (and under bridge) if it exists
|
|
auto {{ discovered_wireless_iface }}
|
|
iface {{discovered_wireless_iface }} inet manual
|
|
pre-up ifconfig $IFACE up
|
|
pre-down ifconfig $IFACE down
|
|
{% endif %}
|
|
|
|
{% if iiab_network_mode == "Appliance" %}
|
|
################# APPLIANCE #########################
|
|
auto {{ discovered_wan_iface }}
|
|
{% if gui_static_wan == false %}
|
|
iface {{ discovered_wan_iface }} inet manual
|
|
{% else %} # gui_static_wan_ip is set
|
|
iface {{ discovered_wan_iface }} inet static
|
|
address {{ gui_static_wan_ip }}
|
|
netmask {{ gui_static_wan_netmask }}
|
|
gateway {{ gui_static_wan_gateway }}
|
|
dns-nameservers {{ gui_static_wan_nameserver }}
|
|
dns-search {{ iiab_domain }}
|
|
{% endif %} {# end of static_wan #}
|
|
{% elif iiab_network_mode == "Gateway" %}
|
|
################# GATEWAY #########################
|
|
auto br0
|
|
iface br0 inet static
|
|
bridge_ports {% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }} {% endif %} {% if discovered_lan_iface != "none" %} {{ discovered_lan_iface }} {% endif %}
|
|
|
|
bridge_maxwait 0
|
|
address {{ lan_ip }}
|
|
netmask {{ lan_netmask }}
|
|
dns-nameservers {{ lan_ip }}
|
|
{% if gui_static_wan == false %}
|
|
auto {{ discovered_wan_iface }}
|
|
iface {{ discovered_wan_iface }} inet dhcp
|
|
{% else %} # gui_static_wan_ip is set
|
|
iface {{ discovered_wan_iface }} inet static
|
|
address {{ gui_static_wan_ip }}
|
|
netmask {{ gui_static_wan_netmask }}
|
|
gateway {{ gui_static_wan_gateway }}
|
|
dns-nameservers {{ gui_static_wan_nameserver }}
|
|
dns-search {{ iiab_domain }}
|
|
post-up systemctl restart dhcpd && systemctl restart hostapd
|
|
{% endif %}
|
|
{% else %} {# end of iiab_network_mode == Gateway #}
|
|
|
|
################# LANCONTROLLER ###################
|
|
auto br0
|
|
iface br0 inet static
|
|
bridge_ports {% if discovered_wireless_iface != "none" %} {{ discovered_wireless_iface }} {% endif %} {% if discovered_wan_iface != "none" %} {{ discovered_wan_iface }} {% endif %}
|
|
|
|
bridge_maxwait 0
|
|
address {{ lan_ip }}
|
|
netmask {{ lan_netmask }}
|
|
gateway {{ lan_ip }}
|
|
dns-nameservers {{ lan_ip }}
|
|
dns-search {{ iiab_domain }}
|
|
post-up systemctl restart dhcpd && systemctl restart hostapd
|
|
{% endif %}
|
|
|