Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 12-01-2004, 04:49 AM   #1
LQ Newbie
Registered: Dec 2004
Posts: 3

Rep: Reputation: 0
Question Iptables with 3 marks. It is possible?


I have the following question.

I am using Linux Redhat as gateway of the my network to internet. I am to making NAT and firewall. I Have 3 nics
eth0 - Local network ( 130 hosts )
eth1 - Link 256 full (route default )
eth2 - Link adsl 2Mb (route to forward: p2p, ftp, pop, smtp and others heavy users)
I am using cbq for to limit download and try to limit uploads.

In my iptables script, I need make 3 MARKs for the same packet, as following

# It marks the packets that will go for link ADSL by ip route / ip rule
iptables -t mangle -A PREROUTING -p tcp --dport 21 -j MARK --set-mark 2000
iptables -t mangle -A PREROUTING -p tcp --dport 20 -j MARK --set-mark 2000

# It marks the packets that will be shapped ( upload with cbq )
iptables -t mangle -A PREROUTING -m mac 00:11:22:33:44:55 -j MARK --set-mark 501
iptables -t mangle -A PREROUTING -m mac aa:bb:cc:dd:ee:ff -j MARK --set-mark 631
###. I have 130 hosts in my network

# It marks the packages that priority has ( with 'tc prio' command)
iptables -t mangle -A PREROUTING -p tcp --dport 22 -j MARK --set-mark 100
iptables -t mangle -A PREROUTING -p tcp --dport 23 -j MARK --set-mark 100
iptables -t mangle -A PREROUTING -p udp --dport 27000:27015 -j MARK --set-mark 110

But only last mark does function

Have solution ?? How to do?

#Marcio P. Silva
Old 12-01-2004, 09:16 AM   #2
LQ Newbie
Registered: Dec 2004
Posts: 3

Original Poster
Rep: Reputation: 0
Unhappy Re: Iptables with 3 marks. It is possible?

Sorry, this message was to be posted in the networking's forum
Old 12-04-2004, 03:34 AM   #3
Senior Member
Registered: May 2001
Location: Indiana
Distribution: Gentoo, Debian, RHEL, Slack
Posts: 1,555

Rep: Reputation: 46
Let the Mods move threads, don't post twice


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Execvp With Quotation Marks amitbern Programming 10 11-25-2005 10:28 AM
no quotation marks jdoe9898 Linux - Newbie 1 10-12-2005 03:07 AM
Iptables with 3 marks. It is possible? thucalila Linux - Networking 0 12-01-2004 09:11 AM
quotaion marks timainge Linux - Newbie 8 05-01-2004 11:06 PM
Need help with book marks Silverw0lf Linux - General 1 10-18-2003 01:43 AM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration