aboutsummaryrefslogtreecommitdiffstats
path: root/sysconfig/network-scripts/ifup
diff options
context:
space:
mode:
authorBill Nottingham <notting@redhat.com>2001-02-06 22:27:25 +0000
committerBill Nottingham <notting@redhat.com>2001-02-06 22:27:25 +0000
commit32d629933257051980054822fc9a92cc5462cfc6 (patch)
treef660d6e62c5ef0ca44fafb538828d8e9d5f15857 /sysconfig/network-scripts/ifup
parent85814c076ce47f2d7ea16c6d41d3ce51be32206a (diff)
downloadinitscripts-32d629933257051980054822fc9a92cc5462cfc6.tar
initscripts-32d629933257051980054822fc9a92cc5462cfc6.tar.gz
initscripts-32d629933257051980054822fc9a92cc5462cfc6.tar.bz2
initscripts-32d629933257051980054822fc9a92cc5462cfc6.tar.xz
initscripts-32d629933257051980054822fc9a92cc5462cfc6.zip
modify the firewall to allow any (new) DNS servers through on ifup
Diffstat (limited to 'sysconfig/network-scripts/ifup')
-rwxr-xr-xsysconfig/network-scripts/ifup17
1 files changed, 17 insertions, 0 deletions
diff --git a/sysconfig/network-scripts/ifup b/sysconfig/network-scripts/ifup
index e64ba822..b661f5bf 100755
--- a/sysconfig/network-scripts/ifup
+++ b/sysconfig/network-scripts/ifup
@@ -93,6 +93,13 @@ if [ -n "${MACADDR}" ]; then
ifconfig ${DEVICE} hw ether ${MACADDR}
fi
+# Is there a firewall running, and does it look like one we configured?
+FWACTIVE=
+if [ -f /etc/sysconfig/ipchains -a "ipchains -L input -n 2>&1 | awk 'END { print NR }'" -gt 1 ]; then
+ FWACTIVE=1
+ export FWACTIVE
+fi
+
if [ -n "${DYNCONFIG}" ]; then
PUMPARGS=
DHCPCDARGS=
@@ -110,14 +117,24 @@ if [ -n "${DYNCONFIG}" ]; then
fi
echo -n $"Determining IP information for ${DEVICE}..."
+ # DHCP clients need DNS to be available, and we don't know
+ # what DNS server they're using until they are done.
+ FWHACK=
+ if [ -n "$FWACTIVE" -a "$FIREWALL_MODS" != "no" ]; then
+ ipchains -I input -s 0/0 53 -p udp -j ACCEPT
+ FWHACK=1
+ fi
+
if [ -x /sbin/pump ] && /sbin/pump ${PUMPARGS} -i ${DEVICE} ; then
echo $" done."
elif [ -x /sbin/dhcpcd ] && /sbin/dhcpcd ${DHCPCDARGS} ${DEVICE} ; then
echo $" done."
else
echo $" failed."
+ [ -n "$FWHACK" ] && ipchains -D input -s 0/0 53 -p udp -j ACCEPT
exit 1
fi
+ [ -n "$FWHACK" ] && ipchains -D input -s 0/0 53 -p udp -j ACCEPT
else
if [ -z "${IPADDR}" ]; then
# enable device without IP, useful for e.g. PPPoE