Linux Netfilter discussions
 help / color / mirror / Atom feed
* Masquerade UDP doesn't work
       [not found] <9435037.2791.1328765711483.JavaMail.root@ixer.mx>
@ 2012-02-09  5:35 ` Enrique Huerta de la Fuente
  2012-02-09 11:05   ` Giles Coochey
  0 siblings, 1 reply; 4+ messages in thread
From: Enrique Huerta de la Fuente @ 2012-02-09  5:35 UTC (permalink / raw)
  To: netfilter

Hello,

Masquerade do not work at a UDP port, but if it works at a TCP port.

(works) iptables -t nat -I POSTROUTING -m tcp -p tcp --dport 22 -o ppp0 -j MASQUERADE
(not working) iptables -t nat -I POSTROUTING -m udp -p udp --dport 1195 -o ppp0 -j MASQUERADE


Any ideas?

regards

E.Huerta
 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Masquerade UDP doesn't work
  2012-02-09  5:35 ` Enrique Huerta de la Fuente
@ 2012-02-09 11:05   ` Giles Coochey
  2012-02-14  1:09     ` Jan Engelhardt
  0 siblings, 1 reply; 4+ messages in thread
From: Giles Coochey @ 2012-02-09 11:05 UTC (permalink / raw)
  To: ehuerta; +Cc: netfilter

On 2012-02-09 05:35, Enrique Huerta de la Fuente wrote:
> Hello,
>
> Masquerade do not work at a UDP port, but if it works at a TCP port.
>
> (works) iptables -t nat -I POSTROUTING -m tcp -p tcp --dport 22 -o
> ppp0 -j MASQUERADE
> (not working) iptables -t nat -I POSTROUTING -m udp -p udp --dport
> 1195 -o ppp0 -j MASQUERADE
>

The "-m udp" confuses me. Do you really need to specify that module, 
try it without the -m option for UDP, I don't tend to use it for TCP 
either, but if it's not broken, don't fix it...

-- 
Message sent via my webmail account.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Masquerade UDP doesn't work
       [not found] <1993130.2906.1328852412074.JavaMail.root@ixer.mx>
@ 2012-02-10  5:41 ` Enrique Huerta de la Fuente
  0 siblings, 0 replies; 4+ messages in thread
From: Enrique Huerta de la Fuente @ 2012-02-10  5:41 UTC (permalink / raw)
  To: giles; +Cc: netfilter

>
>> Hello,
>>
>> Masquerade do not work at a UDP port, but if it works at a TCP port.
>>
>> (works) iptables -t nat -I POSTROUTING -m tcp -p tcp --dport 22 -o
>> ppp0 -j MASQUERADE
>> (not working) iptables -t nat -I POSTROUTING -m udp -p udp --dport
>> 1195 -o ppp0 -j MASQUERADE
>>
>
>The "-m udp" confuses me. Do you really need to specify that module,
>try it without the -m option for UDP, I don't tend to use it for TCP
>either, but if it's not broken, don't fix it...
>

 
Hello,

I try:
iptables -t nat -I POSTROUTING -p udp --dport 1195 -o ppp0 -j MASQUERADE

but it does not work.



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Masquerade UDP doesn't work
  2012-02-09 11:05   ` Giles Coochey
@ 2012-02-14  1:09     ` Jan Engelhardt
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Engelhardt @ 2012-02-14  1:09 UTC (permalink / raw)
  To: Giles Coochey; +Cc: ehuerta, netfilter

On Thursday 2012-02-09 12:05, Giles Coochey wrote:

> On 2012-02-09 05:35, Enrique Huerta de la Fuente wrote:
>> Hello,
>>
>> Masquerade do not work at a UDP port, but if it works at a TCP port.
>>
>> (works) iptables -t nat -I POSTROUTING -m tcp -p tcp --dport 22 -o
>> ppp0 -j MASQUERADE
>> (not working) iptables -t nat -I POSTROUTING -m udp -p udp --dport
>> 1195 -o ppp0 -j MASQUERADE
>>
>
> The "-m udp" confuses me. Do you really need to specify that module, try it
> without the -m option for UDP, I don't tend to use it for TCP either, but if
> it's not broken, don't fix it...

Note that -p only looks at the IP header, but -m udp is required
for the UDP header. So yes, -m udp is required (though it's added
automatically if you forget it).

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2012-02-14  1:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1993130.2906.1328852412074.JavaMail.root@ixer.mx>
2012-02-10  5:41 ` Masquerade UDP doesn't work Enrique Huerta de la Fuente
     [not found] <9435037.2791.1328765711483.JavaMail.root@ixer.mx>
2012-02-09  5:35 ` Enrique Huerta de la Fuente
2012-02-09 11:05   ` Giles Coochey
2012-02-14  1:09     ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox