Skip to contentSkip to conversation

Where libipt_MASQ.so (???)

DISCUSSION Jesús García Crespo (aka Sevein) 3 participants 3 messages Aug 4, 2003

lore
Share & tools
lore
#1 lore raw

Am Mon, 2003-08-04 um 19.57 schrieb Jesús García Crespo (aka Sevein):

Quoted 9 lines

Hola flaq,

Monday, August 4, 2003 7:38:47 PM, you wrote:

f> Try -j MASQUERADE

iptables: Invalid argument

Could you post the whole line you used or try:
iptables -t nat -A POSTROUTING -j MASQUERADE Masquerading is done in the POSTROUTING chain of the nat table!

Cheers,

Ralf

Signature · 6 lines
Ralf Spenneberg
RHCE, RHCX

Book: Intrusion Detection für Linux Server   http://www.spenneberg.com
IPsec-Howto				     http://www.ipsec-howto.org
Honeynet Project Mirror:                     http://honeynet.spenneberg.org
#2 lore raw
In reply to Jesús García Crespo (aka Sevein)
Quoted 3 lines · Jesús García Crespo (aka Sevein)

Monday, August 4, 2003 7:38:47 PM, you wrote:
f> Try -j MASQUERADE
iptables: Invalid argument

You really should have a look at the doc...

Quoted 1 line

iptables -A FORWARD --match mac --mac-source 00:c0:49:c9:d3:f1 -j MASQ

This is wrong. MASQUERADING occurs in nat table, POSTROUTING chain :

iptables -t nat -A POSTROUTING [...] -j MASQUERADE

Moreover, in POSTROUTING chain, source MAC address is not available anymore. So you can't match it. If you really want to use source MAC as a criteria, you will have to mark packets in mangle table PREROUTING chain, then match this mark in your masquerading rule :

	iptables -t mangle -A PREROUTING -m mac --mac-source \
		00:c0:49:c9:d3:f1 -j MARK --set-mark 0x1
	iptables -t nat -A POSTROUTING -m mark --mark 0x1 \
		-j MASQUERADE

Hope that'll help you achieve your goal.

Signature · 2 lines
http://www.netexit.com/~sid/
PGP KeyID: 157E98EE FingerPrint: FA62226DA9E72FA8AECAA240008B480E157E98EE