Monitor the default interface, which is not necessarily eth0
authorSapan Bhatia <gwsapan@gmail.com>
Fri, 11 Feb 2011 03:28:26 +0000 (22:28 -0500)
committerSapan Bhatia <gwsapan@gmail.com>
Fri, 11 Feb 2011 03:28:26 +0000 (22:28 -0500)
iptables.spec
planetlab-config

index dd14149..d7c022b 100644 (file)
@@ -117,6 +117,8 @@ rm -rf %{buildroot}
 %post
 /sbin/ldconfig
 /sbin/chkconfig --add iptables
+DEFAULT_IFACE=$(ip route show default | awk '/default/ {print $5}'
+sed -i -e "s;__eth;$DEFAULT_IFACE;g" /etc/sysconfig/iptables 
 service iptables restart
 
 %postun -p /sbin/ldconfig
index b5954cf..ac5c016 100644 (file)
@@ -18,5 +18,5 @@ COMMIT
 -A INPUT -j MARK --copy-xid 0x0
 -A POSTROUTING -j MARK --copy-xid 0x0 
 -A POSTROUTING -j CLASSIFY --set-class 0001:1000 --add-mark
--A POSTROUTING -o eth0 -j ULOG --ulog-cprange 54 --ulog-qthreshold 16
+-A POSTROUTING -o __eth -j ULOG --ulog-cprange 54 --ulog-qthreshold 16
 COMMIT