feature: Convert network settings files to use dynamic interfaces

config.*/network files now use dynamic interface names so that they can be changed on the fly in the future.
This commit is contained in:
Conrad Lara - KG6JEI 2015-03-25 14:02:38 -07:00
parent ac93a0346f
commit 99182e2b52
6 changed files with 18 additions and 12 deletions

View File

@ -9,7 +9,7 @@ config interface loopback
#### LAN configuration
config interface lan
option type bridge
option ifname "eth0"
option ifname "<lan_intf>"
option proto <lan_proto>
option ipaddr <lan_ip>
option netmask <lan_mask>
@ -19,7 +19,7 @@ config interface lan
#### WAN configuration
config interface wan
option ifname "eth0.1"
option ifname "<intf_wan>"
option proto <wan_proto>
option ipaddr <wan_ip>
option netmask <wan_mask>

View File

@ -8,7 +8,7 @@ config interface loopback
#### LAN configuration
config interface lan
option ifname "eth0"
option ifname "<lan_intf>"
option proto <lan_proto>
option ipaddr <lan_ip>
option netmask <lan_mask>
@ -17,5 +17,5 @@ config interface lan
#### WAN configuration
config interface wan
option ifname "wlan0"
option ifname "<wifi_intf>"
option proto <wifi_proto>

View File

@ -8,7 +8,7 @@ config interface loopback
#### LAN configuration
config interface lan
option ifname "eth0"
option ifname "<lan_intf>"
option proto <lan_proto>
option ipaddr <lan_ip>
option netmask <lan_mask>
@ -18,7 +18,7 @@ config interface lan
#### WAN configuration
config interface wan
option ifname "eth0.1"
option ifname "<intf_wan>"
option proto <wan_proto>
option ipaddr <wan_ip>
option netmask <wan_mask>
@ -27,14 +27,14 @@ config interface wan
#### WIFI configuration
config interface wifi
option ifname "wlan0"
option ifname "<wifi_intf>"
option proto <wifi_proto>
option ipaddr <wifi_ip>
option netmask <wifi_mask>
#### device to device configuration
config interface dtdlink
option ifname "eth0.2"
option ifname "<intf_dtdlink>"
option proto static
option ipaddr <dtdlink_ip>
option netmask 255.0.0.0

View File

@ -9,7 +9,7 @@ config interface loopback
#### LAN configuration
config interface lan
option type bridge
option ifname "eth0"
option ifname "<lan_intf>"
option proto <lan_proto>
option ipaddr <lan_ip>
option netmask <lan_mask>
@ -19,5 +19,5 @@ config interface lan
#### WAN configuration
config interface wan
option ifname "eth0.1"
option ifname "<intf_wan>"
option proto <wan_proto>

View File

@ -9,7 +9,7 @@ config interface loopback
#### LAN configuration
config interface lan
option type bridge
option ifname "eth0"
option ifname "<lan_intf>"
option proto <lan_proto>
option ipaddr <lan_ip>
option netmask <lan_mask>
@ -19,7 +19,7 @@ config interface lan
#### WAN configuration
config interface wan
option ifname "eth0.1"
option ifname "<intf_wan>"
option proto <wan_proto>
option ipaddr <wan_ip>
option netmask <wan_mask>

View File

@ -1,3 +1,4 @@
#!/usr/bin/perl -w -I/www/cgi-bin
=for commnet
@ -126,6 +127,11 @@ foreach $line (`cat /etc/config.$config/_setup`)
$cfg{$1} = $2;
}
$cfg{"lan_intf"} = get_interface("lan");
$cfg{"wifi_intf"} = get_interface("wifi");
$cfg{"wan_intf"} = get_interface("wan");
$cfg{"dtdlink_intf"} = get_interface("dtdlink");
die "configuration load failed\n" unless keys %cfg;