Help me! iptables
Hi Everyone,
I am new to Linux and recently trying to build DNS server with transparent proxy for my Wifi Broadcasting. I'd installed Red Hat Enterprice 4 into my computer and run every configuration needed to build up DNS server such as hosts, host.conf, resolv.conf, named.conf...etc. infrastructure internet (ISP) <-> ADSL2+ modem router <-> mycompany.com (DNS Server) <-> Home Network & Wifi Broadcasting. The server has two ethernet card, eth0 : 192.168.0.5 eth1 : 192.168.1.5 DNS server : 192.168.1.5 ]#ping mycompany.com PING mycomputer.mycompany.com (192.168.1.5) 56 (84) bytes of data. ....etc. The DNS is running fine but my problem now is the iptables. DHCP also running fine both end eth0 and eth1. ==========================PROBLEM ================================= Here the iptables in # /etc/init.d/iptables * Firewall configuration written by system-config securitylevel * Manual Customization of this file is not recommended. *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [0:0] :RH-Firewall-1-INPUT - [0:0] -A INPUT -j RH-Firewall-1-INPUT -A FORWARD -j RH-Firewall-1-INPUT -A RH-Firewall-1-INPUT -i -j ACCEPT -A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT -A RH-Firewall-1-INPUT -p 50 -j ACCEPT -A RH-Firewall-1-INPUT -p 51 -j ACCEPT -A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT -A RH-Firewall-1-INPUT -P udp -m udp --dport 631 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT -A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited -table nat -A PREROUTING -i eth1 -p tcp -dport 80 -j DNAT -to 192.168.1.2:3128 -table nat -A PREROUTING -i eth1 -p tcp -dport 80 -j REDIRECT -to-port 3128 COMMIT When I run it! # /etc/init.d/iptables restart Flush firewll rules : [OK] Setting chains to policy ACCEPT: filter [OK] Unloading iptables modules: [OK] Applying iptables firewall rules: Bad argument 'nat' Error Occurred at line: 24 Try 'iptables-restore -h' or 'iptables-restore --help' for more information [FAILED] I had tried such (-iptable, nat, -t) and simply give me headache. I am ready frustrated because I have been trying for some times but no solutions. Please anyone who can help me solve the problem will be appreciated Best Regards, Sam |
Please post your thread in only one forum. Posting a single thread in the most relevant forum will make it easier for members to help you and will keep the discussion in one place. This thread is being closed because it is a duplicate.
|
All times are GMT -5. The time now is 07:18 PM. |