Sponsored Content
Special Forums IP Networking Upload problem with traffic shaping though a Linux router. Post 302792843 by martio09 on Thursday 11th of April 2013 05:51:32 AM
Old 04-11-2013
Upload problem with traffic shaping though a Linux router.

So I want to limit the download and upload speed of a specific ip adress in a local network. To do this I are using a bach script running in a linux OS (Ubuntu 11.04). The issue here is that the upload shaper does not work. I have tried an alternate solution aswell though that does not work as intended

# Remove old shaping
tc qdisc del dev eth1 root 2> /dev/null > /dev/null
tc qdisc del dev eth1 ingress 2> /dev/null > /dev/null

# Create qdisc
tc qdisc add dev eth1 root handle 1: htb default 30

# Download shaper (works as intended)
tc class add dev eth1 parent 1:1 classid 1:4 htb rate 30000kbt
tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match ip dst 192.168.0.101/32 flowid 1:4

# Upload shaper (does not seam to do anything)
tc class add dev eth1 parent 1:1 classid 1:3 htb rate 3000kbit
tc filter add dev eth1 protocol ip parent 1:0 prio 1 u32 match ip src 192.168.0.101/32 flowid 1:3


### Version 2 of the upload shaper:
# Need eth0 aswell to do this
tc qdisc add dev eth0 root handle 1: htb default 30

# Upload shaper (limits the entire network and not just the one IP)
# The reason for 192.168.0.101/0 is because the src is 10.0.0.166. 10.0.0.166 is the WAN IP adress. I dont get why this is.
# I dont know why i need to change it to eth0 either. It does nothing if i dont.
tc class add dev eth0 parent 1:1 classid 1:3 htb rate 3000kbit
tc filter add dev eth0 protocol ip parent 1:0 prio 1 u32 match ip src 192.168.0.101/0 flowid 1:3


Any help at all would be MUCH appreciated!
 

7 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Traffic Shaping

I'm using FreeBSD because I like how easy the system can be set up, how software can be installed/removed and ... many other reasons:-) But there is a thing I don't know how to deal with: I have few connections behind a machine and I want to give to the machines behind a minimum guaranteed... (2 Replies)
Discussion started by: eNTer
2 Replies

2. IP Networking

Configure router to allow smtp traffic

Hello all, I have installed ubuntu hardy and for some testing I have configured sendmail on it. I have a router facing the internet and I am having hard time configuring the router to allow traffic on port 25 to my server. I have a BCM96338 ADSL Router. I have set iptable rules to allow the... (0 Replies)
Discussion started by: h3llh0l3
0 Replies

3. IP Networking

egress and ingress traffic shaping.

What exactly is the difference between ingress and egress in traffic shaping, what does it mean when we say that imq provies ingress shaping using egress qdisks? (3 Replies)
Discussion started by: Maksim
3 Replies

4. IP Networking

Mac OS X IP traffic shaping question

Not sure if this considered traffic shaping or not, so I'll appreciate the enlightenment... Setup- Mac Pro, Mac OS X 10.5.6, Crashplan Pro Backup server. the Mac Pro has 2 E-net ports, en0, en1. Both E-net ports are connected to the same network, different IP's. Problem- We are planning to... (1 Reply)
Discussion started by: pbenware
1 Replies

5. Cybersecurity

Monitoring network traffic on wireless router

Hi all, How can I monitor packet traffic on my wireless router? Some info - my wireless router is netgear wgr614 - everyone can connect it i.e. no password required - I would like to see where they connect, how they are using the internet connection I installed wireshark and captured... (3 Replies)
Discussion started by: SaTYR
3 Replies

6. IP Networking

Traffic shaping with iptables

hello, I have a postfix & a local dns running on a single server. this server is connected to internet via a low bandwidth line(with fixed ip). we also have another high speed adsl (dynamic ip). i want to divert all dns request from the local dns & postfix from the server to the adsl... (0 Replies)
Discussion started by: coolatt
0 Replies

7. IP Networking

How does a router directs the internet traffic to a specific host in the private network?

how does a router directs the internet traffic to a specific host in the private network? Example: My PC has ip 192.168.134.100 Router has ip 192.168.134.200 My company's ip 202.52.150.33 When i try to access internet, say google, it traverses from... (1 Reply)
Discussion started by: Arun_Linux
1 Replies
Match-all classifier in tc(8)                                          Linux                                         Match-all classifier in tc(8)

NAME
matchall - traffic control filter that matches every packet SYNOPSIS
tc filter ... matchall [ skip_sw | skip_hw ] [ action ACTION_SPEC ] [ classid CLASSID ] DESCRIPTION
The matchall filter allows to classify every packet that flows on the port and run a action on it. OPTIONS
action ACTION_SPEC Apply an action from the generic actions framework on matching packets. classid CLASSID Push matching packets into the class identified by CLASSID. skip_sw Do not process filter by software. If hardware has no offload support for this filter, or TC offload is not enabled for the inter- face, operation will fail. skip_hw Do not process filter by hardware. EXAMPLES
To create ingress mirroring from port eth1 to port eth2: tc qdisc add dev eth1 handle ffff: ingress tc filter add dev eth1 parent ffff: matchall skip_sw action mirred egress mirror dev eth2 The first command creats an ingress qdisc with handle ffff: on device eth1 where the second command attaches a matchall filters on it that mirrors the packets to device eth2. To create egress mirroring from port eth1 to port eth2: tc qdisc add dev eth1 handle 1: root prio tc filter add dev eth1 parent 1: matchall skip_sw action mirred egress mirror dev eth2 The first command creats an egress qdisc with handle 1: that replaces the root qdisc on device eth1 where the second command attaches a matchall filters on it that mirrors the packets to device eth2. To sample one of every 100 packets flowing into interface eth0 to psample group 12: tc qdisc add dev eth0 handle ffff: ingress tc filter add dev eth0 parent ffff: matchall action sample rate 100 group 12 SEE ALSO
tc(8), iproute2 21 Oct 2015 Match-all classifier in tc(8)
All times are GMT -4. The time now is 01:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy