debian:/etc/init.d# cat fire* #!/bin/sh PATH=/usr/sbin:/sbin:/bin:/usr/bin # # delete all existing rules. # iptables -F iptables -t nat -F iptables -t mangle -F iptables -X # Always accept loopback traffic iptables -A INPUT -i lo -j ACCEPT # Allow established connections, and those not coming from the outside iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -m state --state NEW -i ! eth1 -j ACCEPT iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT # Allow outgoing connections from the LAN side. iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT # Masquerade. iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE # Don't forward from the outside to the inside. iptables -A FORWARD -i eth0 -o eth0 -j REJECT iptables -A INPUT -p udp --sport 67 --dport 68 -j ACCEPT iptables -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable iptables -A INPUT -p icmp -j REJECT --reject-with icmp-port-unreachable iptables -A INPUT -p tcp -j REJECT --reject-with tcp-reset iptables -A INPUT -p tcp --dport 113 -j REJECT /sbin/iptables -A INPUT -j REJECT echo "1" > /proc/sys/net/ipv4/ip_forward debian:/etc/init.d# cat /proc/sys/net/ipv4/ip_forward 1 debian:/etc/init.d# ifconfig eth0 Link encap:Ethernet HWaddr 00:13:46:E1:EA:47 inet addr:X.X.X.X Bcast:81.229.105.255 Mask:255.255.255.0 inet6 addr: fe80::213:46ff:fee1:ea47/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:10213 errors:0 dropped:0 overruns:0 frame:0 TX packets:7074 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:7161170 (6.8 MiB) TX bytes:761588 (743.7 KiB) Interrupt:10 Base address:0x3000 eth1 Link encap:Ethernet HWaddr 00:50:BA:1A:C5:75 inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::250:baff:fe1a:c575/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:2605 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 b) TX bytes:124256 (121.3 KiB) Interrupt:9 Base address:0x3400 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 inet6 addr: ::1/128 Scope:Host UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:550 errors:0 dropped:0 overruns:0 frame:0 TX packets:550 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:66633 (65.0 KiB) TX bytes:66633 (65.0 KiB)