Skip to contentSkip to conversation

IMQ / new Dummy device post.

DISCUSSION Andy Furniss 4 participants 19 messages Apr 15, 2004 – Apr 19, 2004 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw
Quoted 8 lines

What am i looking for?
1) users and authors of IMQ to tell me if this achieves what IMQ >started as. I have to say I DONT like the level of obstrutiveness from IMQ as >is today. The code added by this is small (100 or less lines on top of dummy) and doesnt touch any of the main core bits.
2) testing of the above by people who use IMQ
3) If someone has better ideas - i am not religious about keeping this; but it certainly cant be the blasphemy that IMQ introduces

I am just a user and would drop IMQ without hesitation for something you consider more elegant, but I am not sure whether or not dummy will do what I want.

The only reason I use IMQ (+ NAT patch) is that I need to shape ingress (I know I can't shape it "properly" from the wrong end of the bottleneck without an intelligent app, but the ingress policer does not let me share local and forwarded bandwidth and is not fair per user if I just throttle the whole link).

I am not sure if dummy will sort this for me, there may be some other way?

Basically all I need is something I can use HTB on where the qos ingress box is on this diagram.

http://www.docum.org/stef.coene/qos/kptd/

Andy.

#1 lore raw
Quoted 8 lines · Andy Furniss

The only reason I use IMQ (+ NAT patch) is that I need to shape ingress (I know I can't shape it "properly" from the wrong end of the bottleneck without an intelligent app, but the ingress policer does not let me share local and forwarded bandwidth and is not fair per user if I just throttle the whole link).

I am not sure if dummy will sort this for me, there may be some other way?

The summary is dummy can do what IMQ used to; it is however not related to iptables/netfilter.

Quoted 2 lines

Basically all I need is something I can use HTB on where the qos ingress box is on this diagram.

Yes you can attach a HTB. Look at the posted example in the previous email and replace prio with HTB.
Not sure i answered your questions.

Again to emphasize: I will send patches only to people interested. People have to ask directly;
this is my way of monitoring what is being tested. At some point i will make the latest patches available to everyone.

cheers,
jamal

#2 lore raw
Quoted 12 lines · jamal
Quoted 3 lines · Andy Furniss

The only reason I use IMQ (+ NAT patch) is that I need to shape ingress (I know I can't shape it "properly" from the wrong end of the bottleneck without an intelligent app, but the ingress policer does not let me share local and forwarded bandwidth and is not fair per user if I just throttle the whole link).

I am not sure if dummy will sort this for me, there may be some other way?

The summary is dummy can do what IMQ used to; it is however not related to iptables/netfilter.

Quoted 5 lines
Quoted 1 line

Basically all I need is something I can use HTB on where the qos ingress box is on this diagram.

Yes you can attach a HTB. Look at the posted example in the previous email and replace prio with HTB. Not sure i answered your questions.

What I want to know is what state IP packets will be in if I filter/shape with dummy - In my case I would need them to have been demasqued so I can tell the difference between local and to be forwarded ingress traffic.

Ie. where on the KPTD would dummy be - IMQ appears twice and by using the IMQ nat patch I can use the prerouting one to filter/shape the packets after they are denatted.

Andy.

Quoted 8 lines

Again to emphasize: I will send patches only to people interested. People have to ask directly;
this is my way of monitoring what is being tested. At some point i will make the latest patches available to everyone.

cheers,
jamal

#3 lore raw
Quoted 3 lines · Andy Furniss

jamal wrote:

What I want to know is what state IP packets will be in if I

Just to be sure, this is not specific just to IP; it could be ARP, IPX, v6 etc.

Quoted 4 lines

filter/shape with dummy - In my case I would need them to have been demasqued so I can tell the difference between local and to be forwarded ingress traffic.

The packets are grabbed before NAT on the way in and after NAT on the way out.
Coming from non-local machines before NAT you can redirect to a dummy device; and also be able to redirect on their way back to the non-local; to use the example i posted earlier:

----
$TC qdisc add dev dummy0 root handle 1: prio
$TC qdisc add dev dummy0 parent 1:1 handle 10: sfq
$TC qdisc add dev dummy0 parent 1:2 handle 20: tbf rate 20kbit buffer 1600 limit
3000
$TC qdisc add dev dummy0 parent 1:3 handle 30:
sfq

$TC filter add dev dummy0 protocol ip pref 1 parent 1: handle 1 fw classid 1:1
$TC filter add dev dummy0 protocol ip pref 2 parent 1: handle 2 fw classid 1:2

ifconfig dummy0 up

#deal with ingress of eth0 first
$TC qdisc add dev eth0 ingress

# redirect all IP packets arriving from 10.0.0.21/24 in eth0 to dummy0 
# use mark 1 --> puts them onto class 1:1 of dummy
#
$TC filter add dev eth0 parent ffff: protocol ip prio 10 u32 \
match ip src 10.0.0.21/24 flowid 1:1 \
action ipt -j MARK --set-mark 1 \
action mirred egress redirect dev dummy0

#deal with egress of eth0
$TC qdisc add dev eth0 root handle 1: prio

# redirect all IP packets going to 10.0.0.21/24 in eth0 to dummy0 
# use mark 2 --> puts them onto class 1:2 of dummy
#
$TC filter add dev eth0 parent 1:0 protocol ip prio 10 u32 \
match ip dst 10.0.0.21/24 flowid 1:1 \
action ipt -j MARK --set-mark 2 \
action mirred egress redirect dev dummy0
-----

I havent tested the above but it should work (sans syntax bugs). If it doesnt then we have a bug that needs fixing.

Quoted 4 lines

Ie. where on the KPTD would dummy be - IMQ appears twice and by using the IMQ nat patch I can use the prerouting one to filter/shape the packets after they are denatted.

does the above help?

cheers,
jamal

#4 lore raw
Quoted 13 lines · jamal
Quoted 4 lines · Andy Furniss

jamal wrote:

What I want to know is what state IP packets will be in if I

Just to be sure, this is not specific just to IP; it could be ARP, IPX, v6 etc.

Quoted 1 line
Quoted 5 lines
Quoted 1 line

filter/shape with dummy - In my case I would need them to have been demasqued so I can tell the difference between local and to be forwarded ingress traffic.

The packets are grabbed before NAT on the way in and after NAT on the way out.

This is what I wanted to know. Is it possible to make an option to get them after NAT in and pre NAT out?

Quoted 40 lines

Coming from non-local machines before NAT you can redirect to a dummy device; and also be able to redirect on their way back to the non-local; to use the example i posted earlier:

----
$TC qdisc add dev dummy0 root handle 1: prio $TC qdisc add dev dummy0 parent 1:1 handle 10: sfq $TC qdisc add dev dummy0 parent 1:2 handle 20: tbf rate 20kbit buffer
1600 limit
3000
$TC qdisc add dev dummy0 parent 1:3 handle 30:
sfq

$TC filter add dev dummy0 protocol ip pref 1 parent 1: handle 1 fw classid 1:1
$TC filter add dev dummy0 protocol ip pref 2 parent 1: handle 2 fw classid 1:2

ifconfig dummy0 up

#deal with ingress of eth0 first
$TC qdisc add dev eth0 ingress

# redirect all IP packets arriving from 10.0.0.21/24 in eth0 to dummy0 # use mark 1 --> puts them onto class 1:1 of dummy
#
$TC filter add dev eth0 parent ffff: protocol ip prio 10 u32 \
match ip src 10.0.0.21/24 flowid 1:1 \
action ipt -j MARK --set-mark 1 \
action mirred egress redirect dev dummy0

#deal with egress of eth0
$TC qdisc add dev eth0 root handle 1: prio

# redirect all IP packets going to 10.0.0.21/24 in eth0 to dummy0 # use mark 2 --> puts them onto class 1:2 of dummy
#
$TC filter add dev eth0 parent 1:0 protocol ip prio 10 u32 \
match ip dst 10.0.0.21/24 flowid 1:1 \
action ipt -j MARK --set-mark 2 \
action mirred egress redirect dev dummy0
-----
Quoted 2 lines

I havent tested the above but it should work (sans syntax bugs). If it doesnt then we have a bug that needs fixing.

I don't think this applies to my setup Masqerading many local onto one real address.

Quoted 7 lines
Quoted 4 lines

Ie. where on the KPTD would dummy be - IMQ appears twice and by using the IMQ nat patch I can use the prerouting one to filter/shape the packets after they are denatted.

does the above help?

Yes - Thanks.

Andy.

Quoted 5 lines

cheers,
jamal

#6 lore raw
In reply to a message not in the archive
Quoted 7 lines · jamal
Quoted 1 line · Andy Furniss

This is what I wanted to know. Is it possible to make an option to get them after NAT in and pre NAT out?

No i dont plan to. Why do you want to go that path?

I think it's the only way I can shape/share my ingress traffic between a
process (eg. bittorrent/squid) running on my shaping machine and
traffic that is forwarded to my LAN. I masquerade onto one real dynamic IP.

In the case of pre nat outbound - I know people can mark pre NAT and shape on that, but it would allow people with big LANs doing NAT to use WRR/ESFQ on src for egress traffic.

Quoted 9 lines
Quoted 3 lines

I don't think this applies to my setup Masqerading many local onto one real address.

If you have local on eth0(or substitute with whatever device you have local on), the example i gave should work fine. You just have to change the way you approach the setup. In case i didnt understand you, please post the details of your setup.

My setup is very simple - the only reason I use IMQ+NAT patch is because I want to use my gateway/shaping PC to run bittorrent and I want the LAN machines to have priority/fair share of incoming traffic. I guess my setup is not that common - more common are people who run squid on the same PC they shape/do NAT on.

ppp0 one dynamic real IP -> gateway PC -> eth0 -> LAN 192.168.0.0/24

                                  |
                                   -> local process.

Andy.

#7 lore raw
Quoted 5 lines · Andy Furniss
Quoted 1 line

No i dont plan to. Why do you want to go that path?

I think it's the only way I can shape/share my ingress traffic between a
process (eg. bittorrent/squid) running on my shaping machine and
traffic that is forwarded to my LAN. I masquerade onto one real dynamic IP.

I think i am almost understanding you now. Your main concern is people using bittorrent to upload to you, correct?
Is there a way to recognize packets going to/from bittorent?

Quoted 3 lines

In the case of pre nat outbound - I know people can mark pre NAT and shape on that, but it would allow people with big LANs doing NAT to use WRR/ESFQ on src for egress traffic.

Dont jump into the HOW; lets get to your setup and dissect it. Like i said, dont think in terms of IMQ but still think in terms of meeting your requirements.
Your setup is certainly new to me (at least from what i have been told or read on how people use IMQ) - so thanks for posting. This is the kind of thing i needed to hear about.

Quoted 9 lines

My setup is very simple - the only reason I use IMQ+NAT patch is because I want to use my gateway/shaping PC to run bittorrent and I want the LAN machines to have priority/fair share of incoming traffic. I guess my setup is not that common - more common are people who run squid on the same PC they shape/do NAT on.

ppp0 one dynamic real IP -> gateway PC -> eth0 -> LAN 192.168.0.0/24

                                   |
                                    -> local process.

Ok good. Assuming you have attached your HTB etc on one or more dummy devices.

- packets from local Lan can be marked at ingress and redirect to a dummy if needed. Infact you can do this on the egress at ppp0 as well using the new tc -i <inputdev> that i introduced. So this is easy.

- packets from the bittorent process can be marked by iptables before they get NATed (is this right?). Such packets can then be redirected to dummy from egress of ppp0 using fw classifier. So again this is easy.

- The third path is packets that come in from ppp0, get demasquareded, then have to either go a) to the LAN/eth0 or b)localhost bittorent process. You want to restrict b) - is that correct? I have some suggestion, but need you to verify this part.

cheers,
jamal

#8 lore raw
Quoted 5 lines · jamal
Quoted 2 lines · Andy Furniss
Quoted 1 line

No i dont plan to. Why do you want to go that path?

Quoted 7 lines
Quoted 3 lines

I think it's the only way I can shape/share my ingress traffic between a
process (eg. bittorrent/squid) running on my shaping machine and
traffic that is forwarded to my LAN. I masquerade onto one real dynamic IP.

I think i am almost understanding you now. Your main concern is people
using bittorrent to upload to you, correct? Is there a way to recognize packets going to/from bittorent?

Quite possibly (though I think it uses connmark which I can't use as I use connbytes to get new tcps out of slowstart).

I also sometimes use wget and I've seen posts on LARTC from people who use squid and need to solve the same problem.

Quoted 23 lines
Quoted 3 lines

In the case of pre nat outbound - I know people can mark pre NAT and shape on that, but it would allow people with big LANs doing NAT to use WRR/ESFQ on src for egress traffic.

Dont jump into the HOW; lets get to your setup and dissect it. Like i
said, dont think in terms of IMQ but still think in terms of meeting
your requirements.
Your setup is certainly new to me (at least from what i have been told or read on how people use IMQ) - so thanks for posting. This is the kind of thing i needed to hear about.

Quoted 5 lines

My setup is very simple - the only reason I use IMQ+NAT patch is because I want to use my gateway/shaping PC to run bittorrent and I want the LAN machines to have priority/fair share of incoming traffic. I guess my setup is not that common - more common are people who run squid on the same PC they shape/do NAT on.

ppp0 one dynamic real IP -> gateway PC -> eth0 -> LAN 192.168.0.0/24

                                  |
                                   -> local process.

Ok good. Assuming you have attached your HTB etc on one or more dummy devices.

Quoted 7 lines

- packets from local Lan can be marked at ingress and redirect to a dummy if needed. Infact you can do this on the egress at ppp0 as well using the new tc -i <inputdev> that i introduced. So this is easy.

- packets from the bittorent process can be marked by iptables before they get NATed (is this right?). Such packets can then be redirected to dummy from egress of ppp0 using fw classifier. So again this is easy.

Yes - egress is sortable without IMQ.

Quoted 4 lines

- The third path is packets that come in from ppp0, get demasquareded, then have to either go a) to the LAN/eth0 or b)localhost bittorent process. You want to restrict b)

Well not just restrict - dynamically share per IP total incoming bandwidth with LAN traffic using HTB.

Andy.

- is that correct? I have some

Quoted 6 lines

suggestion, but need you to verify this part.

cheers,
jamal

#9 lore raw
Quoted 8 lines · Andy Furniss
Quoted 3 lines · jamal

I think i am almost understanding you now. Your main concern is people using bittorrent to upload to you, correct?
Is there a way to recognize packets going to/from bittorent?

Quite possibly (though I think it uses connmark which I can't use as I use connbytes to get new tcps out of slowstart).

You are speaking Inuit to me. What is connmark? and what is the relation to tcp slowstart.

Quoted 2 lines

I also sometimes use wget and I've seen posts on LARTC from people who use squid and need to solve the same problem.

I am gonna assume that you have some way to recognize the flows destined to localhost which you want to punish.

Quoted 13 lines
Quoted 12 lines
Quoted 7 lines

ppp0 one dynamic real IP -> gateway PC -> eth0 -> LAN 192.168.0.0/24

                                  |
                                   -> local process.

Ok good. Assuming you have attached your HTB etc on one or more dummy devices.

Quoted 6 lines
Quoted 3 lines

- The third path is packets that come in from ppp0, get demasquareded, then have to either go a) to the LAN/eth0 or b)localhost bittorent process. You want to restrict b)

Well not just restrict - dynamically share per IP total incoming bandwidth with LAN traffic using HTB.

Sure - thats assumed since you attach HTB to the dummy device.

To accomodate your need for b), the idea would be as follows:
packet gets demasquared, mark it with a fwmark based on some recognition you have for bittorent or squid and lastly policy route it to the dummy device based on fwmark (since routing happens last).
I will need to modify the dummy to not drop such packets which are fwmarked.

cheers,
jamal

#10 lore raw
Quoted 6 lines · jamal
Quoted 1 line · Andy Furniss

jamal wrote:

Quoted 10 lines
Quoted 4 lines
Quoted 2 lines

I think i am almost understanding you now. Your main concern is people
using bittorrent to upload to you, correct? Is there a way to recognize packets going to/from bittorent?

Quite possibly (though I think it uses connmark which I can't use as I use connbytes to get new tcps out of slowstart).

You are speaking Inuit to me. What is connmark? and what is the relation to tcp slowstart.

Connmark is a netfilter patch which is required by the type of P2P limiting/marking projects on sf.net that could mark bittorrent traffic. It is incompatable with the connbytes patch which I use to mark the first x KB of new connections. Doing this lets me send new TCps to a short queue which is capped at 50% of my bandwidth. This means that some packets get dropped and the slowstart phase is ended before it's exponential nature floods my ISP buffer.

Put another way - I can game without latency spikes while a couple of people are browsing "heavy .jpg" type websites. It only works well if my link is otherwise clear - but this is a common situation for my home setup.

Quoted 24 lines
Quoted 1 line

I also sometimes use wget and I've seen posts on LARTC from people who use squid and need to solve the same problem.

I am gonna assume that you have some way to recognize the flows destined to localhost which you want to punish.

Quoted 17 lines
Quoted 16 lines
Quoted 6 lines

ppp0 one dynamic real IP -> gateway PC -> eth0 -> LAN 192.168.0.0/24

                                 |
                                  -> local process.

Ok good. Assuming you have attached your HTB etc on one or more dummy devices.

- The third path is packets that come in from ppp0, get demasquareded, then have to either go a) to the LAN/eth0 or b)localhost bittorent process. You want to restrict b)

Quoted 7 lines
Quoted 1 line

Well not just restrict - dynamically share per IP total incoming bandwidth with LAN traffic using HTB.

Sure - thats assumed since you attach HTB to the dummy device.

To accomodate your need for b), the idea would be as follows:
packet gets demasquared, mark it with a fwmark

I guess you really mean mark then demasquerade.

Quoted 5 lines

based on some recognition
you have for bittorent or squid and lastly policy route it to the dummy device based on fwmark (since routing happens last).
I will need to modify the dummy to not drop such packets which are fwmarked.

OK I can see this as a possibility - assuming I can mark. Maybe conmark will be OK with connbytes sometime. I don't really know how to use it, but if it is possible to mark egress connections in output and have connmark match their incoming packets that would be a solution. I haven't got a clue if connmark can do this, though, just speculating.

Does anyone else know, and why it's not compatable with connbytes?

Andy.

Quoted 5 lines

cheers,
jamal

#11 lore raw

Andy Furniss wrote:
<snip>

Quoted 6 lines
Quoted 2 lines

To accomodate your need for b), the idea would be as follows:
packet gets demasquared, mark it with a fwmark

I guess you really mean mark then demasquerade.

Quoted 8 lines
Quoted 5 lines

based on some recognition
you have for bittorent or squid and lastly policy route it to the dummy device based on fwmark (since routing happens last).
I will need to modify the dummy to not drop such packets which are fwmarked.

OK I can see this as a possibility - assuming I can mark. Maybe conmark will be OK with connbytes sometime. I don't really know how to use it, but if it is possible to mark egress connections in output and have connmark match their incoming packets that would be a solution. I haven't got a clue if connmark can do this, though, just speculating.

Hmm second thoughts - if I can route packets to dummy after demasquerade then I don't need to mark - I can use u32 as I do now to seperate per IP. Am I missing something here?

Quoted 14 lines

Does anyone else know, and why it's not compatable with connbytes?

Andy.

Quoted 5 lines

cheers,
jamal

#15 lore raw
In reply to Andy Furniss
Quoted 2 lines · Andy Furniss

Connmark is a netfilter patch which is required by the type of P2P limiting/marking projects on sf.net that could mark bittorrent traffic.

just from the sounds of it, appears it may be able to mark a group of related flows with the same fwmark.

Quoted 5 lines

It is incompatable with the connbytes patch which I use to mark the first x KB of new connections. Doing this lets me send new TCps to a short queue which is capped at 50% of my bandwidth. This means that some packets get dropped and the slowstart phase is ended before it's exponential nature floods my ISP buffer.

seems very similar in concept to what Alex ([email protected]) was trying to achieve.

Quoted 4 lines
Quoted 2 lines

To accomodate your need for b), the idea would be as follows:
packet gets demasquared, mark it with a fwmark

I guess you really mean mark then demasquerade.

Either should work fine.

Quoted 1 line

OK I can see this as a possibility - assuming I can mark. Maybe conmark

sounds like connmark maybe what you want.

Quoted 7 lines

will be OK with connbytes sometime. I don't really know how to use it, but if it is possible to mark egress connections in output and have connmark match their incoming packets that would be a solution. I haven't got a clue if connmark can do this, though, just speculating.

Does anyone else know, and why it's not compatable with connbytes?

some of the netfilter people should be able to help.

cheers,
jamal

#12 lore raw
In reply to Andy Furniss
Quoted 3 lines · Andy Furniss

Hmm second thoughts - if I can route packets to dummy after demasquerade then I don't need to mark - I can use u32 as I do now to seperate per IP. Am I missing something here?

The problem is dummy had some speacial reason for existence in the old days of slip/ppp dummy acts as blackhole;
some apps insist(ed) on getting a static IP address
on primary interface when you are offline. So people would typically setup routes to the dummy device where packets just get swalloed.

I have a feeling there are people who still use this functionality somewhere in the globe (sorry i am from .ca dont know what that means anymore;->). And i dont want to break this functionality. So what i was thinking is i will have dummy spare any fwmarked packets and reinject them back.
Another alternative is to just fsck this backward compatibility mode because people could use blackhole routes today.
Yet another alternative is to create a brand new device and call it something like imq2. For such little code, this may be overkill.

cheers,
jamal

#16 lore raw
In reply to jamal
Quoted 7 lines · jamal
Quoted 2 lines · Andy Furniss

Connmark is a netfilter patch which is required by the type of P2P limiting/marking projects on sf.net that could mark bittorrent traffic.

just from the sounds of it, appears it may be able to mark a group of related flows with the same fwmark.

connmark is like nfmark but it marks the connection-entry in ip_conntrack instead. And then you can "restore" that mark to the nfmark of the packet at any time you want with filter rules.

Quoted 9 lines
Quoted 7 lines

will be OK with connbytes sometime. I don't really know how to use it, but if it is possible to mark egress connections in output and have connmark match their incoming packets that would be a solution. I haven't got a clue if connmark can do this, though, just speculating.

Does anyone else know, and why it's not compatable with connbytes?

some of the netfilter people should be able to help.

with connmark you mark the connection, and then you can "restore" that mark to packets in either direction in the mangle table of iptables.

connmark isn't incompatible with connbytes. It's just that both patches modify the same part of the code, a struct, and the patch program can't handle that. You'll have to fix some rejects by hand, that's it.

Signature · 1 line
/Martin
#13 lore raw
In reply to jamal
Quoted 12 lines · jamal
Quoted 1 line · Andy Furniss

Hmm second thoughts - if I can route packets to dummy after demasquerade then I don't need to mark - I can use u32 as I do now to seperate per IP. Am I missing something here?

The problem is dummy had some speacial reason for existence in the old
days of slip/ppp dummy acts as blackhole; some apps insist(ed) on getting a static IP address on primary interface when you are offline. So people would typically
setup routes to the dummy device where packets just get swalloed.

Quoted 5 lines

I have a feeling there are people who still use this functionality somewhere in the globe (sorry i am from .ca dont know what that means anymore;->). And i dont want to break this functionality. So what i was thinking is i will have dummy spare any fwmarked packets and reinject them back.

I think this would still be a solution for me - I allready mark everything coming in on ppp0 in prerouting filter (pre demasquerade) into three classes - interactive, new and
bulk. I then use u32 to further share bulk per dst IP post demasquerade on the HTB/IMQ. So as long as I can route to dummy post demasquerade I don't need IMQ. This would be alot better than messing around with connmark.

Andy.

Quoted 7 lines

Another alternative is to just fsck this backward compatibility mode because people could use blackhole routes today.
Yet another alternative is to create a brand new device and call it something like imq2. For such little code, this may be overkill.

cheers,
jamal

#14 lore raw
Quoted 1 line · Andy Furniss

I think this would still be a solution for me - I allready mark everything coming in on ppp0 in prerouting filter

I meant mangle not filter of course :-)

Andy.

#17 lore raw
In reply to Martin Josefsson
Quoted 24 lines · Martin Josefsson
Quoted 7 lines · jamal
Quoted 1 line · Andy Furniss

Connmark is a netfilter patch which is required by the type of P2P limiting/marking projects on sf.net that could mark bittorrent traffic.

just from the sounds of it, appears it may be able to mark a group of related flows with the same fwmark.

connmark is like nfmark but it marks the connection-entry in ip_conntrack instead. And then you can "restore" that mark to the nfmark of the packet at any time you want with filter rules.

Quoted 6 lines
Quoted 4 lines

will be OK with connbytes sometime. I don't really know how to use it, but if it is possible to mark egress connections in output and have connmark match their incoming packets that would be a solution. I haven't got a clue if connmark can do this, though, just speculating.

Does anyone else know, and why it's not compatable with connbytes?

some of the netfilter people should be able to help.

Quoted 7 lines

with connmark you mark the connection, and then you can "restore" that mark to packets in either direction in the mangle table of iptables.

connmark isn't incompatible with connbytes. It's just that both patches modify the same part of the code, a struct, and the patch program can't handle that. You'll have to fix some rejects by hand, that's it.

Thanks for that - though I hope not to have to use it now, just to confirm - does it work in all of the 5 mangle tables or more specifically could I mark every connection from local processes in output and restore the marks in prerouting?

Andy.

#18 lore raw
Quoted 8 lines · Andy Furniss
Quoted 7 lines

with connmark you mark the connection, and then you can "restore" that mark to packets in either direction in the mangle table of iptables.

connmark isn't incompatible with connbytes. It's just that both patches modify the same part of the code, a struct, and the patch program can't handle that. You'll have to fix some rejects by hand, that's it.

Quoted 4 lines

Thanks for that - though I hope not to have to use it now, just to confirm - does it work in all of the 5 mangle tables or more specifically could I mark every connection from local processes in output and restore the marks in prerouting?

It works in all of the 5 mangle chains iirc.

/Martin

#19 lore raw
In reply to jamal

[...]

Quoted 3 lines

- packets from local Lan can be marked at ingress and redirect to a dummy if needed. Infact you can do this on the egress at ppp0 as well using the new tc -i <inputdev> that i introduced. So this is easy.

Hmm I don't see -i option in the patches.
what's the point of having a -i <inputdev> option ?
does it mean I can work on egress at ppp0 and use -i eth0 to match packets that were originaly from eth0 ?
I personnaly use netfilter to mark packets and 'handle $mark fw' to filter them. (that may explain why i don't see the point :-)