Skip to contentSkip to conversation

Masquerade and tc filter

LARTC Tadas 2 participants 3 messages Apr 27, 2003

lore
Share & tools
lore

Tadas

author
#0 lore raw

Hello,

I am building a gateway/shaper. As always, there is a locl network 192.168.3.0/24 and connection to internet. Gateway masquerades these connections. I need to limit upload and download speed for certain IPs. With download traffic everything is ok: i have put filters on the local netwrok interface. But I can't set up filters by source address on outgoing traffic - the interface which makes masquerading. I have noticed that all traffic have the same router source address set.

So, what's the solution? Maybe it is imposible? But I have looked through wondershaper and I saw that there are source address filters.

Please give me a hint. I am using kernel 2.4.20.

Bye,
Tadas

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

author
#1 lore raw

I know what imq is. Everything is O.K. with download traffic. I need to shape Upload traffic. But the problem is that u32 filter does not match correct source address for forwarded packets - only gateway's.

Bye,
Tadas

----- Original Message -----
From: "peyrak" <[email protected]>
To: "Tadas" <[email protected]>
Sent: Sunday, April 27, 2003 11:51 AM
Subject: Re: [LARTC] Masquerade and tc filter

Quoted 16 lines

imq

###########################

# Jirka Pirko             #
# [email protected]          #
# [email protected]       #
# cellular: +420608065259 #
# icq uin: 136218111      #
###########################
----- Original Message -----
From: "Tadas" <[email protected]>
To: <[email protected]>
Sent: Sunday, April 27, 2003 8:43 AM
Subject: [LARTC] Masquerade and tc filter
Quoted 7 lines
Quoted 5 lines

Hello,

I am building a gateway/shaper. As always, there is a locl network 192.168.3.0/24 and connection to internet. Gateway masquerades these connections. I need to limit upload and download speed for certain IPs.

With

Quoted 1 line

download traffic everything is ok: i have put filters on the local

netwrok

Quoted 2 lines
Quoted 2 lines

interface. But I can't set up filters by source address on outgoing traffic - the interface which makes masquerading. I have noticed that

all

Quoted 3 lines
Quoted 3 lines

traffic have the same router source address set.

So, what's the solution? Maybe it is imposible? But I have looked

through

Quoted 4 lines
Quoted 4 lines

wondershaper and I saw that there are source address filters.

Please give me a hint. I am using kernel 2.4.20.

Quoted 9 lines
Quoted 7 lines

Bye,
Tadas

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/

#2 lore raw
In reply to Tadas
Quoted 10 lines · Tadas

Hello,

I am building a gateway/shaper. As always, there is a locl network 192.168.3.0/24 and connection to internet. Gateway masquerades these connections. I need to limit upload and download speed for certain IPs. With download traffic everything is ok: i have put filters on the local netwrok interface. But I can't set up filters by source address on outgoing traffic - the interface which makes masquerading. I have noticed that all traffic have the same router source address set.

Quoted 4 lines

So, what's the solution? Maybe it is imposible? But I have looked through wondershaper and I saw that there are source address filters.

Please give me a hint. I am using kernel 2.4.20.

The solution is to mark the packets when they enter your firewall. Give each ip a different mask (so this happens before the src address is rewritten). When they leave the firewall, you can use that mark with the fw filter. That mark only exists in your kernel memory, so it's only valid in your firewall.

Stef

Signature · 8 lines
[email protected]
 "Using Linux as bandwidth manager"
     http://www.docum.org/
     #lartc @ irc.oftc.net

_______________________________________________
LARTC mailing list / [email protected]
http://mailman.ds9a.nl/mailman/listinfo/lartc HOWTO: http://lartc.org/