summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Ullrich <sullrich@G5.local>2009-10-26 12:43:46 -0400
committerScott Ullrich <sullrich@G5.local>2009-10-26 12:43:46 -0400
commit1d894eafbfc039a29d782dc8c1d7956f8e6489f2 (patch)
treea4827469eccdeec2b02afe2170f5f9614961b5e2
parentd0c04c77547ad47dbe4a5cbafcadd890f4734daf (diff)
downloadpfsense-1d894eafbfc039a29d782dc8c1d7956f8e6489f2.zip
pfsense-1d894eafbfc039a29d782dc8c1d7956f8e6489f2.tar.gz
Switch over to handling DNS from ppp.linkup allowing mulitple 3G cards to coexist on the same box
-rw-r--r--etc/inc/interfaces.inc2
-rw-r--r--etc/inc/system.inc9
-rwxr-xr-xsbin/ppp-script16
3 files changed, 17 insertions, 10 deletions
diff --git a/etc/inc/interfaces.inc b/etc/inc/interfaces.inc
index 72e408c..124d0d2 100644
--- a/etc/inc/interfaces.inc
+++ b/etc/inc/interfaces.inc
@@ -927,7 +927,7 @@ function interface_ppp_configure($ifcfg) {
$i++;
$startingip++;
$rclinkup.= "{$dev}:\n";
- $rclinkup.= " ! sh -c \"/sbin/ppp-script HISADDR INTERFACE\"\n";
+ $rclinkup.= " ! sh -c \"/sbin/ppp-script HISADDR INTERFACE DNS1 DNS2 \"\n";
$rclinkup.= " ! sh -c \"/etc/rc.linkup INTERFACE start\"\n";
}
}
diff --git a/etc/inc/system.inc b/etc/inc/system.inc
index 988a68f..6b75fcf 100644
--- a/etc/inc/system.inc
+++ b/etc/inc/system.inc
@@ -134,15 +134,6 @@ function get_nameservers() {
global $config, $g;
$master_list = array();
- // Read in ppp resolv.conf item
- $ppp_resolv_conf = $g["varetc_path"] . "/ppp_resolv.conf";
- if(file_exists($ppp_resolv_conf)) {
- $dns_items = split("\n", `cat $ppp_resolv_conf | grep nameserver | cut -d' ' -f2`);
- foreach($dns_items as $dns_item)
- if($dns_item)
- $master_list[] = $dns_item;
- }
-
// Read in dhclient nameservers
$dns_lists = split("\n", `ls /var/etc/nameserver_* 2>/dev/null`);
if(is_array($dns_lists)) {
diff --git a/sbin/ppp-script b/sbin/ppp-script
index 3f2ca5c..1749eb4 100755
--- a/sbin/ppp-script
+++ b/sbin/ppp-script
@@ -1,3 +1,19 @@
#!/bin/sh
+# Set the router for this interface
/sbin/ifconfig $2 | grep "$1" | awk '{ print $2 }' > /tmp/$2_router
+
+# Remove file if it exists
+if [ -f /var/etc/nameserver_$2 ]; then
+ rm -f /var/etc/nameserver_$2
+fi
+
+# DNS1
+if [ "$3" != "" ]; then
+ echo $3 >> /var/etc/nameserver_$2
+fi
+
+# DNS2
+if [ "$4" != "DNS2" ]; then
+ echo $4 >> /var/etc/nameserver_$2
+fi \ No newline at end of file
OpenPOWER on IntegriCloud