IPTABLES QUESTIONS

Doug Lawlor dlawlor at roadrunner.nf.net
Tue Sep 10 16:04:22 EDT 2002


Hello list,  When I forward ports to a machine behind a firewall
traffic only seems to be going to the lowest port in the range.    The
following list using the command 'iptables -t nat -L' illustrates this.  

DNAT       udp  --  anywhere
hostname.domainudp dpts:2074:2076
to:192.168.0.2:2074
DNAT       udp  --  anywhere
hostname.domainudp dpts:4074:4076
to:192.168.0.2:4074

The commands used to forward the ports are as follows:

# Forward ports 2074-2076 to 192.168.0.2
iptables -A PREROUTING -t nat -p udp -d $MYIP --dport 2074:2076 -j DNAT
--to 192.168.0.2:2074:2076
# Forward ports 4074-4076 to 192.168.0.2
iptables -A PREROUTING -t nat -p udp -d $MYIP --dport 4074:4076 -j DNAT
--to 192.168.0.2:4074:4076

$MYIP is a variable which gets the current dynamically assigned IP
from
eth0 using the following sed expression
MYIP=`ifconfig eth0 | sed '/.*addr:/!d;s///;s/ .*//'`

If I am thinking straight the list generated with 'iptables -t nat -L'
should look like the following.  

DNAT       udp  --  anywhere
hostname.domainudp dpts:2074:2076
to:192.168.0.2:2074:2076
DNAT       udp  --  anywhere
hostname.domainudp dpts:4074:4076
to:192.168.0.2:4074:4076

How can I make this happen?  The iptables commands I am using in the
firewall script are just not doing it.  

Thanks in advance,  

Doug

-- 
Make sure your E-mail can be read by everyone!
http://www.betips.net/etc/evilmail.html

Doug Lawlor <dlawlor at roadrunner.nf.net>




More information about the Speakup mailing list