Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Traffic Control Issue, please help


    Hi all!

    I am at the very beggining of entering into the world of linux and networks! I got basic knowledge of tcp/ip networks and routing. I've set up home network and everything is working fine. I got 3 interfaces on my router: eth0:Internet; eth1: Internal Network; eth2: DMZ. It's all set up with iptables and is working fine.

    I want to implement traffic control using tc, which is part of the kernel. But it seems very difficult to me, I've read a couple of tutorials, but I still don't get it right... so can anyone please help me for this:

    I want to prioritize the network traffic for HTTP/HTTPS/MYSQL usage as about 80 % of all bandwidth, which must go through my DMZ part of the network. There I got Microsoft Windows 2003 server, which has Web & SQL Server on it. I need the network traffic to be prioritized to eth2, whenever some users try to access its web/mysql services, and the other traffic should to stay at 20%, while the main traffic is in use.

    Please help me to achieve this, I will be very gratefull!

  2. #2
    Hi,
    Take a look at WonderShaper here : Wonder Shaper
    It's basicaly a small bash script using tc
    You wan use it as it is (just enter your bandwidth and port you want to prioritize) or in your case with 3 interface you can look at how tc work and customize it yourself easily.

  3. #3

    Re:

    Thank you for the source. I've read it up, and I tried to build something, like a working HTB QDISK, but I failed

    The error which I receive is:
    [root@test1 ~]# ./my-tc-basic.htb
    RTNETLINK answers: No such file or directory
    We have an error talking to the kernel
    RTNETLINK answers: No such file or directory
    We have an error talking to the kernel

    Please, help me out to find where my error is, i will be very very very thankfull. Here is my kind of script:

    Code:
    #!/bin/bash
    #
    # Variables:
    TC="/sbin/tc"
    
    #eth0 (10.100.40.0/24 WAN) -------------------------------------
    $TC qdisc del dev eth0 root
    $TC qdisc add dev eth0 handle 10: root htb
    $TC class add dev eth0 parent 10: classid 10:10 htb rate 100Mbit
    $TC class add dev eth0 parent 10:10 classid 10:102 htb rate 20mbit ceil 100mbit
    $TC class add dev eth0 parent 10:10 classid 10:101 htb rate 80mbit ceil 100mbit
    $TC filter add dev eth0 parent 10:0 protocol ip prio 1 u32 match ip src 192.168.8.0/24 flowid 10:102
    $TC filter add dev eth0 parent 10:1 protocol ip prio 2 u32 match ip src 192.168.9.0/24 flowid 10:101
    
    #eth1 (192.168.8.0/24 Internal LAN)
    $TC qdisc del dev eth1 root
    $TC qdisc add dev eth1 handle 11: root htb
    $TC class add dev eth1 parent 11: classid 11:11 htb rate 100Mbit
    $TC class add dev eth1 parent 11:11 classid 11:102 htb rate 20mbit ceil 100mbit
    $TC class add dev eth1 parent 11:11 classid 11:101 htb rate 80mbit ceil 100mbit
    $TC filter add dev eth1 parent 11:0 protocol ip prio 1 u32 match ip src 10.100.40.0/24 flowid 11:102
    $TC filter add dev eth1 parent 11:1 protocol ip prio 2 u32 match ip src 192.168.9.0/24 flowid 11:101
    
    #eth2 (192.168.9.0/24) DMZ
    $TC qdisc del dev eth2 root
    $TC qdisc add dev eth2 handle 12: root htb
    $TC class add dev eth2 parent 12: classid 12:12 htb rate 100Mbit
    $TC class add dev eth2 parent 12:12 classid 12:102 htb rate 20mbit ceil 100mbit
    $TC class add dev eth2 parent 12:12 classid 12:101 htb rate 80mbit ceil 100mbit
    $TC filter add dev eth2 parent 12:0 protocol ip prio 1 u32 match ip src 10.100.40.0/24 flowid 12:101

  4. $spacer_open
    $spacer_close

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •