Skip to contentSkip to conversation

iptables udp 1195 MASQUERADE

DISCUSSION Enrique Huerta de la Fuente 3 participants 5 messages Feb 10, 2012 – Feb 14, 2012 1 message not in the archive

lore
Share & tools
lore
#1 lore raw
In reply to a message not in the archive
Quoted 20 lines
Quoted 6 lines

I have four interfaces and the default gateway is eth1

- eth0 (LAN)
- eth1 (internet link)
- eth3 (internet link)

- ppp0 (internet link)

Quoted 8 lines

I mark (mangle) package udp (1195) for out by interface ppp0. "iptables -t mangle -I OUTPUT -p udp -m udp --dport 1195 -j MARK --set-mark 1

and when i try MASQUERADE the package udp (1195) with "iptables -t nat -I POSTROUTING -p udp -m udp --dport 1195 -o ppp0 -j MASQUERADE", does not work!!

I'm still not sure exactly what you're trying to achieve. Presumably you want different traffic going out on different interfaces, source-natted to that interface IP address.

Quoted 6 lines

If so, why not route your traffic as you are already doing (I assume that is working) and then just MASQUERADE each interface:

iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE

Andy

Yes, I routed traffic by different interfaces, MASQUERADE each interface and it works, I know that because I do the same with the TCP (22) packages (iptables -t nat -I POSTROUTING -p tcp -m tcp --dport 22 -o ppp0 -j MASQUERADE) and it works very well. But only the UDP(1195) packages do not work.

I have dealt with:
iptables -t nat -I POSTROUTING -p udp -m udp --dport 1195 -o ppp0 -j MASQUERADE iptables -t nat -I POSTROUTING -p udp --dport 1195 -o ppp0 -j MASQUERADE iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE

but it does not work.

Any ideas?

E.Huerta

#2 lore raw
Quoted 3 lines · Enrique Huerta de la Fuente

iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE

but it does not work.

Are you *sure* it's not working?

Quoted 2 lines

Any ideas?

Upgrade maybe? As said previously, it's always worked for me.

Andy

#3 lore raw
Quoted 5 lines · Enrique Huerta de la Fuente
Quoted 3 lines

iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE

but it does not work.

Quoted 8 lines

Are you *sure* it's not working?

Quoted 2 lines

Any ideas?

Upgrade maybe? As said previously, it's always worked for me.

Andy

Andy, thank you very much for the attention.

I will continue investigating.

E.Huerta

#4 lore raw
In reply to Andrew Beverley
Quoted 6 lines · Andrew Beverley
Quoted 3 lines · Enrique Huerta de la Fuente

iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE

but it does not work.

Are you *sure* it's not working?

Sorry to jump in here, but, I agree with Enrique, could you show some tcpdump output or something?
- Do the paquet go out from ppp0 without being MASQUERAD'ed?
- Do they go out from an other interface?
- Does it look like they are being filtered? or REDIRECT'ed?

Quoted 13 lines
Quoted 3 lines

Any ideas?

Upgrade maybe? As said previously, it's always worked for me.

Andy

--
To unsubscribe from this list: send the line "unsubscribe netfilter" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 12 lines · Andrew Beverley
Quoted 6 lines · Enrique Huerta de la Fuente
Quoted 3 lines

iptables -t nat -I POSTROUTING -o ppp0 -j MASQUERADE

but it does not work.

Are you *sure* it's not working?

Sorry to jump in here, but, I agree with Enrique, could you show some tcpdump output or something?
- Do the paquet go out from ppp0 without being MASQUERAD'ed?
- Do they go out from an other interface?

- Does it look like they are being filtered? or REDIRECT'ed?

Quoted 8 lines
Quoted 8 lines
Quoted 3 lines

Any ideas?

Upgrade maybe? As said previously, it's always worked for me.

Andy

Hello Sam, this is my outputs: