1
0
Fork 0
mirror of https://github.com/iiab/iiab.git synced 2025-03-09 15:40:17 +00:00
iiab/roles/network/templates/network/iiab.j2
georgejhunt ed2b5d78f2 just move our config to interfaces.d (#247)
* just move our config to interfaces.d

* debian needs same fix as rpi

* try to recover/upgrade from putting wrong content in interfaces -- restore it

* modify dhcpcd.conf for gui static changes

* cannot comment out jinja2 with #, need to wipe the {%

* deny Lan for dhcpcd, will need work if wifi is used upstream

* attempt to change ip from console without requiring a reboot

* Revert "attempt to change ip from console without requiring a reboot"

This reverts commit 14c7499cdc.

Better not to break an upstream connection

* cleanup the iiab.j2 template --changing only comment lines
2017-09-15 22:31:09 -07:00

48 lines
1.7 KiB
Django/Jinja

# Generated by IIAB
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# iiab_network_mode is {{ gui_desired_network_role }}
{% if discovered_wireless_iface != 'none' %}
auto {{ discovered_wireless_iface }}
iface {{discovered_wireless_iface }} inet manual
{% endif %}
{% if iiab_network_mode == "Appliance" %}
################# APPLIANCE #########################
auto {{ discovered_wan_iface }}
# if gui_static_wan == true dhcpcd.conf will be modified
iface {{ discovered_wan_iface }} inet manual
{% 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 }}
# change for debian 9, let dhcpcd.conf set the static ip
# if gui_static_wan == True
auto {{ discovered_wan_iface }}
iface {{ discovered_wan_iface }} inet manual
{% 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 %}