problems converting iptables script from eth2 ....
You mean you don't get any access to the Internet from any machines on your private network and / or from the firwall machine itself?
I have the same mysterious problems until I tweaked these:
# Flushing pre-existing rules:
iptables --flush INPUT
iptables --flush OUTPUT
iptables --flush FORWARD
iptables -t nat --flush
iptables -t mangle --flush
# Policies
# Set the default policy:
iptables --policy INPUT ACCEPT
iptables --policy OUTPUT ACCEPT
iptables --policy FORWARD DROP
# This rule affects LAN access to the Internet.
# If DROPped access is denied.
iptables -t nat --policy PREROUTING ACCEPT
# This rule affects the localhost:
iptables -t nat --policy OUTPUT ACCEPT
# Specifies source changes to outgoing packets routed
# through the box (SourceNAT, MASQUERADE). Somehow, # setting this to DROP denies access to X-server. iptables -t nat --policy POSTROUTING ACCEPT
# This rule affects packets originating from the LAN
# and is destined for the Internet: iptables -t mangle --policy PREROUTING ACCEPT
# This rule affects Internet access for the host machine
# and pings originating from the LAN: if set to drop then access is # denied! # A drop policy does not affect LAN access to the Internet. iptables -t mangle --policy OUTPUT ACCEPT
I don't know what the problem is the above settings restored my services again when I had a similar settup to yours. Right now I'm rewritting FORWARD rules for eth0/eth1 pairing, INPUT/OUTPUT rules for eth0(Internet connected) as well as INPUT/OUTPUT rules for eth1 (private LAN connected). My new rules may mean that I will be able to set the aforementioned rules to DROP.
Maybe this helps you a bit in some way.
This firewall has 2 NICs for private LAN and 1 to connect to Internet. I can access Internet from firewall fine with new DSL service if I kill iptables filtering.
I tried to modify old static ip script for DSL. (eth2 became ppp0)
Now I have a new guess...
Does DSL/PPPoE need to open certain other ports, etc. I don't know about?? If so that would explain why it don't work with old static ip script that closes all ports it don't need.
Chris
Quoted 54 lines · Santi
You mean you don't get any access to the Internet from any machines on your private network and / or from the firwall machine itself?
I have the same mysterious problems until I tweaked these:# Flushing pre-existing rules:
iptables --flush INPUT
iptables --flush OUTPUT
iptables --flush FORWARD
iptables -t nat --flush
iptables -t mangle --flush# Policies
# Set the default policy:
iptables --policy INPUT ACCEPT
iptables --policy OUTPUT ACCEPT
iptables --policy FORWARD DROP# This rule affects LAN access to the Internet.
# If DROPped access is denied.
iptables -t nat --policy PREROUTING ACCEPT# This rule affects the localhost:
iptables -t nat --policy OUTPUT ACCEPT# Specifies source changes to outgoing packets routed
# through the box (SourceNAT, MASQUERADE). Somehow, # setting this to DROP denies access to X-server. iptables -t nat --policy POSTROUTING ACCEPT# This rule affects packets originating from the LAN
# and is destined for the Internet: iptables -t mangle --policy PREROUTING ACCEPT# This rule affects Internet access for the host machine
# and pings originating from the LAN: if set to drop then access is # denied! # A drop policy does not affect LAN access to the Internet. iptables -t mangle --policy OUTPUT ACCEPTI don't know what the problem is the above settings restored my services again when I had a similar settup to yours. Right now I'm rewritting FORWARD rules for eth0/eth1 pairing, INPUT/OUTPUT rules for eth0(Internet connected) as well as INPUT/OUTPUT rules for eth1 (private LAN connected). My new rules may mean that I will be able to set the aforementioned rules to DROP.
Maybe this helps you a bit in some way.
Signature · 13 lines
_______________________________________ Dr. Christian Seberino SPAWAR Systems Center San Diego Code 2363 49590 Lassing Road, Room A339 San Diego, CA 92152-6147 U.S.A. Phone: (619) 553-7940 Fax: (619) 553-1269 Email: [email protected] _______________________________________
Quoted 7 lines · On Wednesday 29 January 2003 06:05 pm, [email protected] wrote:
This firewall has 2 NICs for private LAN and 1 to connect to Internet. I can access Internet from firewall fine with new DSL service if I kill iptables filtering.
I tried to modify old static ip script for DSL. (eth2 became ppp0)
Quoted 6 lines
Now I have a new guess...
Does DSL/PPPoE need to open certain other ports, etc. I don't know about?? If so that would explain why it don't work with old static ip script that closes all ports it don't need.
No other communications needed, unless there's some custom client that the ISP has made you install.
You are going to have problems with $INTERNET_ADDRESS in your rules, though, since that is now subject to change. Is it truly dynamic? If it usually only changes on reboot, you can get around it by setting $INTERNET_ADDRESS in the start of the script equal to:
$(/sbin/ifconfig "$EXTIF" | grep inet | cut -d":" -f 2 | cut -d" " -f 1) ($EXTIF is what I use, I believe you had INTERNET_INTERFACE?)
If your IP is 'really' dynamic, you will probably need to remove that match from the rules, and change "-j SNAT --to $INTERNET_ADDRESS" to "-j MASQUERADE", also adding "echo 1 > /proc/sys/net/ipv4/ip_dynaddr" to enable automatic tracking of the dynamic IP.
I also have a suspicion, which will take you but a moment to explore. With your connection up, go to console and try "ifconfig ppp0" and "cat /etc/resolv.conf" and see if you have any conflict with your "reserved_networks" list. For my service, my own IP and the nameservers are public, but the P-t-P server (the 'gateway' that I talk to) is a 10.10.x.x IP. I have encountered setups before where the assigned IP or the nameservers are also in a 'reserved' private range, which would mean problems with your script.
j