diff options
Diffstat (limited to 'core/conf/iptables/ipt-client.sh')
-rw-r--r-- | core/conf/iptables/ipt-client.sh | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/core/conf/iptables/ipt-client.sh b/core/conf/iptables/ipt-client.sh index abead40..d19a9dc 100644 --- a/core/conf/iptables/ipt-client.sh +++ b/core/conf/iptables/ipt-client.sh @@ -1,14 +1,23 @@ #!/bin/bash echo "setting client network..." -source /etc/iptables/ipt-conf.sh -source /etc/iptables/ipt-firewall.sh -ipt_clear -ipt_tables - -# Unlimited on loopback -$IPT -A INPUT -i lo -s 127.0.0.0/8 -d 127.0.0.0/8 -j ACCEPT -$IPT -A OUTPUT -o lo -s 127.0.0.0/8 -d 127.0.0.0/8 -j ACCEPT + +if [ "${GW}" == "" ]; then + + $IPT -A INPUT -j srv_icmp + $IPT -A OUTPUT -j srv_icmp + $IPT -A INPUT -j srv_dhcp + $IPT -A OUTPUT -j srv_dhcp + + echo "no gateway, wating for one..." + + while [ "${GW}" == "" ] + do + #we wait for a connection + sleep 2; + GW=$(ip route | grep "default via" | cut -d " " -f 3) + done +fi ####### Input Chain ###### $IPT -A INPUT -j blocker |