Skip to contentSkip to conversation

MARKing according to both net. interfaces?

LARTC Stephane Bortzmeyer 2 participants 3 messages Oct 25, 2001 – Oct 26, 2001

lore
Share & tools
lore
#0 lore raw

[I had no success on the netfilter mailing list so may be here? I don't think there is a mailing list devoted to tc?]

In order to later shape the traffic with tc, I'm trying to use iptables to mark traffic with a condition on both network interfaces (in and out).

iptables -t mangle -A PREROUTING -p tcp -i eth4 -o eth5 -j MARK --set-mark 0x4

is accepted but ipchains -v shows that no packets are marked. I assume this is because, in PREROUTING, you don't know the output interface yet.

1) Am I correct?

2) Why is it accepted if it cannot work?

3) Is there a solution, since the mangle table only has OUTPUT (where -i is not accepted) and PREROUTING? (FreeBSD zealots keep screaming to me that it works fine with FreeBSD.)

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

#1 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 11 lines · you

[I had no success on the netfilter mailing list so may be here? I don't think there is a mailing list devoted to tc?]

In order to later shape the traffic with tc, I'm trying to use iptables to mark traffic with a condition on both network interfaces (in and out).

iptables -t mangle -A PREROUTING -p tcp -i eth4 -o eth5 -j MARK --set-mark 0x4

iptables

Quoted 3 lines

is accepted but ipchains -v shows that no packets are marked. I assume this is because, in PREROUTING, you don't know the output interface yet.

Why the hell are you involving ipchains into this?=) ipchains != iptables. They are mutually exclusive. If one works, the other wont work properly. To list the iptables chains do iptables -L. To list the mangle table do iptables
- -t mangle -L.

Quoted 3 lines

1) Am I correct?

No=).

Quoted 2 lines

2) Why is it accepted if it cannot work?

It does work. However, you used two mutually exclusive commands to make the command and to list the commands. Also, the rule only marks packets going from the network on eth4 to network on eth5. Are you sure there is any packets going in those directions?.

Quoted 4 lines

3) Is there a solution, since the mangle table only has OUTPUT (where -i is not accepted) and PREROUTING? (FreeBSD zealots keep screaming to me that it works fine with FreeBSD.)

OUTPUT is broken. Use PREROUTING. Packets doing the above wouldn't travel through the mangle table OUTPUT chain either.

Anyways, hope this helps.

Quoted 8 lines

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

- --
-----------------------------------

|Oskar Andreasson                   |
|Multisoft Education AB             |
|http://www.libendo.com             |
|phone: +46-8-6635555               |
|mailto: [email protected]   |

-----------------------------------
BOFH excuse #172:

pseudo-user on a pseudo-terminal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQE72TBbxO3KTTz2r/kRAk1uAJ940W+DHpo+itxt5355IhStaak+2wCfds6J OfJjpJErV+A66XRtWXiMV0c=gKaE
-----END PGP SIGNATURE-----

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

#2 lore raw
In reply to Stephane Bortzmeyer
Quoted 1 line · On Fri, Oct 26, 2001 at 11:43:51AM +0200, Oskar Andreasson…
Quoted 1 line

is accepted but ipchains -v shows that no packets are marked. I

It was a typo, I meant iptables.

Quoted 1 line

Why the hell are you involving ipchains into this?=) ipchains !iptables.

I know, it was just a typo, I used only iptables. Same question.

Quoted 1 line

OUTPUT is broken. Use PREROUTING.

Did you try by yourself?

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