LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 10-19-2010, 11:31 PM   #1
Washington Ratso
LQ Newbie
 
Registered: Sep 2010
Posts: 27

Rep: Reputation: 0
Traffic Control


How are packets treated that do not match any of the filters?
 
Old 10-19-2010, 11:40 PM   #2
sag47
Senior Member
 
Registered: Sep 2009
Location: Raleigh, NC
Distribution: Ubuntu, PopOS, Raspbian
Posts: 1,899
Blog Entries: 36

Rep: Reputation: 477Reputation: 477Reputation: 477Reputation: 477Reputation: 477
Depends on the program you use for filtering and the type of filtering you use.

If you're using blacklist filtering then any packets which do not match any filters are allowed.

If you're using whitelist filtering then any packets which do not match and filters are blocked.

Whitelist is more secure and usually preferred on intranet traffic. For internet traffic blacklisting is usually used considering the mass of information.

Does this answer your question? If not you'll have to provide more information.

Last edited by sag47; 10-19-2010 at 11:42 PM.
 
Old 10-20-2010, 11:20 AM   #3
Washington Ratso
LQ Newbie
 
Registered: Sep 2010
Posts: 27

Original Poster
Rep: Reputation: 0
Looking at an example from "Designing and Implementing Linux Firewalls and QoS using netfilter, iproute2, NAT, and L7-filter":

/* Root qdisc */
tc qdisc add dev eth1 root handle 10: htb

/* Child class */
tc class add dev eth1 parent 10:0 classid 10:10 htb rate 100Mbit

/* Client class #1 qdisc and filter */
tc class add dev eth1 parent 10:10 classid 10:100 htb rate 1Mbit
tc qdisc add dev eth1 parent 10:100 sfq quantum 1514b perturb 15
tc filter add dev eth1 protocol ip parent 10:0 prio 5 u32 match ip dst 1.1.1.1 flowid 10:100

/* Client class #2 qdisc and filter */
tc class add dev eth1 parent 10:10 classid 10:200 htb rate 4Mbit
tc qdisc add dev eth1 parent 10:200 sfq quantum 1514b perturb 15
tc filter add dev eth1 parent 10:0 protocol ip prio 5 u32 match ip dst 1.1.2.0/24 flowid 10:200

/* Client class #3 qdisc and filter */
tc class add dev eth1 parent 10:10 classid 10:300 htb rate 5Mbit
tc qdisc add dev eth1 parent 10:300 sfq quantum 1514b perturb 15
tc filter add dev eth1 parent 10:0 protocol ip prio 5 u32 match ip dst 1.1.1.2 flowid 10:300
tc filter add dev eth1 parent 10:0 protocol ip prio 5 u32 match ip dst 1.1.3.0/24 flowid 10:300


What will happen to a packet addressed to a destination that is not specified by one of the filters, e.g., 10.174.100.101?
 
Old 10-20-2010, 08:12 PM   #4
Washington Ratso
LQ Newbie
 
Registered: Sep 2010
Posts: 27

Original Poster
Rep: Reputation: 0
I was able to get my traffic control working and saw that traffic that is not specified by a filter does indeed go through. The question I have now is how can I delete a filter without affecting the other filters. Here are the commands I used to initialled create the qdiscs, classes, and filters:

/root/tc qdisc add dev eth0 root handle 2 htb default 1
/root/tc class add dev eth0 parent 2: classid 2:6 htb rate 12Mbit


Connection #1
/root/tc class add dev eth0 parent 2:6 classid 2:100 htb rate 350Kbit
/root/tc qdisc add dev eth0 parent 2:100 sfq
/root/tc filter add dev eth0 parent 2: protocol ip pref 1 u32 match ip src 10.175.1.2 match ip dst 10.174.100.101 match ip sport 32867 0xffff match ip dport 5111 0xffff match ip protocol 17 0xff classid 2:100

Connection #2
/root/tc class add dev eth0 parent 2:6 classid 2:101 htb rate 550Kbit
/root/tc qdisc add dev eth0 parent 2:101 sfq
/root/tc filter add dev eth0 parent 2: protocol ip pref 1 u32 match ip src 10.175.1.2 match ip dst 10.174.100.101 match ip sport 32866 0xffff match ip dport 5222 0xffff match ip protocol 17 0xff classid 2:101


After a connection is destroyed, I want to delete the filter for that connection. Say Connection #1 is destroyed first. If I run:

/root/tc filter del dev eth0 parent 2: protocol ip pref 1 u32 match ip src 10.175.1.2 match ip dst 10.174.100.101 match ip sport 32867 0xffff match ip dport 5111 0xffff match ip protocol 17 0xff classid 2:100


BOTH filters get deleted. How can I delete a single filter without deleting other filters? I want to use classid 2:101 for another connection after Connection #1 is destroyed.
 
Old 10-20-2010, 08:15 PM   #5
Washington Ratso
LQ Newbie
 
Registered: Sep 2010
Posts: 27

Original Poster
Rep: Reputation: 0
I should have said, "I want to use classid 2:100 (NOT 101) for another connection after Connection #1 is destroyed" in the above post.
 
  


Reply



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
[SOLVED] Traffic Control and Report Blatrix Linux - Software 17 12-09-2010 01:41 PM
tc traffic control tc traffic control Linux QoS control tool(noob help) inv|s|ble Linux - General 1 07-26-2007 11:12 AM
traffic control in firewalls gherutza Linux - Networking 1 05-15-2007 01:12 AM
traffic control sunreflex4 Linux - Networking 1 03-23-2003 11:52 AM
about traffic control in redhat 7.1 cmardhekar Linux - Networking 2 12-21-2001 01:37 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:32 PM.

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