This service will be undergoing maintenance at 00:00 UTC, 2016-09-28. It is expected to last about 1 hours
Bug 7465 - PPP initscripts with multiple ISPs
PPP initscripts with multiple ISPs
Status: CLOSED NOTABUG
Product: Red Hat Linux
Classification: Retired
Component: initscripts (Show other bugs)
6.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bill Nottingham
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 1999-11-30 21:28 EST by Craig B. Markwardt
Modified: 2014-03-16 22:11 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 1999-12-06 14:27:04 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Craig B. Markwardt 1999-11-30 21:28:39 EST
I use my RedHat 6.1 machine to connect to multiple ISPs which have
different name servers.  Each one has its own PPP interface.
Unfortunately, there is no apparent way to select different name
servers for each interface.

Here is are two small patches for ifup-ppp and ifdown-ppp which
allow you to do this. If DNSSRVS is defined in ifcfg-pppX, then these
servers are added to /etc/resolv.conf when the device is brought up.

The DNSSRVS variable is used for the same thing in the PCMCIA package.

Craig

diff -u ifup-ppp.orig ifup-ppp
--- ifup-ppp.orig       Tue Nov  9 23:44:26 1999
+++ ifup-ppp    Tue Nov  9 23:45:32 1999
@@ -75,6 +75,20 @@
   chatdbg="-v"
 fi

+# Set up DNS resolver
+RESOLV=/etc/resolv.conf
+if [ -n "$DNSSRVS" ]; then
+    cp $RESOLV $RESOLV.N
+    echo "# $DEVICE begin" >> $RESOLV.N
+    test "$DOMAIN" && echo "domain $DOMAIN" >> $RESOLV.N
+    test "$SEARCH" && echo "search $SEARCH" >> $RESOLV.N
+    for DNS in $DNSSRVS ; do
+       echo "nameserver $DNS" >> $RESOLV.N
+    done
+    echo "# $DEVICE end" >> $RESOLV.N
+    mv $RESOLV.N $RESOLV
+fi
+
 if [ -z "$WVDIALSECT" ] ; then
   CHATSCRIPT=/etc/sysconfig/network-scripts/chat-$DEVNAME
   [ -f $CHATSCRIPT ] || {

diff -u ifdown-ppp.orig ifdown-ppp
--- ifdown-ppp.orig     Tue Nov  9 23:41:39 1999
+++ ifdown-ppp  Tue Nov  9 23:43:18 1999
@@ -9,6 +9,14 @@

 file=/var/run/pppwatch-$DEVICE.pid

+RESOLV=/etc/resolv.conf
+# Remove nameservers
+if fgrep -q "# $DEVICE begin" $RESOLV ; then
+    sed -e "/# $DEVICE begin/,/# $DEVICE end/d"        \
+       < $RESOLV > $RESOLV.N
+    mv $RESOLV.N $RESOLV
+fi
+
 if [ ! -f $file ]; then
     # ppp isn't running, or we didn't start it
     exit 0
Comment 1 Michael K. Johnson 1999-12-06 14:27:59 EST
This is already done for you, set
DNS1=foo
and
DNS2=bar
in your /etc/sysconfig/network-scripts/ifcfg-* files and your
/etc/resolv.conf file will be munged appropriately.

Note You need to log in before you can comment on or make changes to this bug.