Skip to contentSkip to conversation

A DNAT question.

DISCUSSION Ted Gervais 3 participants 4 messages Feb 5, 2005 – Feb 7, 2005

lore
Share & tools
lore
#0 lore raw

I am new to this list and to iptables generally.

I have a line I am trying to translate into a current iptables line that will work in my firewall.

' DNAT net loc:192.168.0.147 udp 5198,5199 '

If anyone could venture a thought as to how that might be translated into a current iptables statement I would really appreicate it.

I have tried - iptables -t nat -A PREROUTING -i eth0 -d 192.168.0.1 -p tcp --dport 5198:5199 -j DNAT --to 192.168.0.147

That doesn't appear to work so obviously I have not interpreted that line correctly..

---
The big cities of America are becoming Third World countries.
-- Nora Ephron

Ted Gervais
Coldbrook Nova Scotia
Canada B4R1A7

#1 lore raw
Quoted 6 lines · Ted Gervais

I am new to this list and to iptables generally.

I have a line I am trying to translate into a current iptables line that will work in my firewall.

' DNAT net loc:192.168.0.147 udp 5198,5199 '

if can you tell us in english what that line does, we can probably translate it into an iptables rule for you.

Quoted 5 lines

If anyone could venture a thought as to how that might be translated into a current iptables statement I would really appreicate it.

I have tried - iptables -t nat -A PREROUTING -i eth0 -d 192.168.0.1 -p tcp --dport 5198:5199 -j DNAT --to 192.168.0.147

that line says, packets arriving inbound to eth0 with destination IP 192.168.0.1 and destination TCP port 5198-5199 will have their destination IP translated to 192.168.0.147 and the destination port will not be translated.

after writing that out--your rule that you're trying to translate specified protocol UDP; whereas your iptables rule uses TCP--maybe that's the problem?

Quoted 2 lines

That doesn't appear to work so obviously I have not interpreted that line correctly..

keep in mind that once the packet is translated in the nat table, it still passes through the filter table, and will require a rule in filter to allow it through.

-j

--
"Be careful when we capture him! We cannot claim the reward unless
we have 51% of the carcass"
--The Simpsons

#2 lore raw
In reply to Ted Gervais
Quoted 14 lines · --- Ted Gervais

I am new to this list and to iptables generally.

I have a line I am trying to translate into a
current iptables line that
will work in my firewall.

' DNAT net loc:192.168.0.147 udp 5198,5199 '

If anyone could venture a thought as to how that
might be translated into
a current iptables statement I would really
appreicate it.

Quoted 8 lines

I have tried - iptables -t nat -A PREROUTING -i eth0 -d 192.168.0.1 -p tcp
--dport 5198:5199 -j DNAT --to 192.168.0.147

That doesn't appear to work so obviously I have not interpreted that line
correctly..

I experienced a similar problem with a rule like iptables -t nat -A PREROUTING -d 200.65.184.223 -j DNAT --to 192.168.0.10

and it does not work until I put the rule at the begining changing the -A to -I

I do not know exactly why this work but it works. I guess that the the rules of redirecting should comes before any other rule.

Hope this help.

=====

Signature · 12 lines
Sergio Basurto J.

If I have seen further it is by standing on the 
shoulders of giants. (Isaac Newton)
--


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Easier than ever with enhanced search. Learn more.
http://info.mail.yahoo.com/mail_250
#3 lore raw
Quoted 34 lines · --- Sergio Basurto Juarez
Quoted 7 lines · --- Ted Gervais

I am new to this list and to iptables generally.

I have a line I am trying to translate into a
current iptables line that
will work in my firewall.

Quoted 8 lines

' DNAT net loc:192.168.0.147 udp 5198,5199 '

If anyone could venture a thought as to how that
might be translated into
a current iptables statement I would really
appreicate it.

I have tried - iptables -t nat -A PREROUTING -i

eth0

Quoted 4 lines

-d 192.168.0.1 -p tcp
--dport 5198:5199 -j DNAT --to 192.168.0.147

That doesn't appear to work so obviously I have

not

Quoted 3 lines

interpreted that line
correctly..

I experienced a similar problem with a rule like iptables -t nat -A PREROUTING -d 200.65.184.223 -j DNAT --to 192.168.0.10

and it does not work until I put the rule at the begining changing the -A to -I

Quoted 6 lines

I do not know exactly why this work but it works. I guess that the the rules of redirecting should comes before any other rule.

Hope this help.

Also check the protocol because in your rule you put udp and in your rule of iptables you choose tcp, you must change your protocol to udp.

=====

Signature · 12 lines
Sergio Basurto J.

If I have seen further it is by standing on the 
shoulders of giants. (Isaac Newton)
--


		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Find what you need with new enhanced search.
http://info.mail.yahoo.com/mail_250