Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
/tc qdisc del dev eth0 root 2> /dev/null > /dev/null
./tc qdisc del dev eth0 ingress 2> /dev/null > /dev/null
./tc qdisc del dev eth1 root 2> /dev/null > /dev/null
# eth0 (internal :D)
./tc qdisc add dev eth0 root handle 1: htb default 41
./tc class add dev eth0 parent 1: classid 1:1 htb rate 10240kbit ceil 10240kbit
./tc class add dev eth0 parent 1:1 classid 1:2 htb rate 2000kbit ceil 2000kbit prio 1
./tc class add dev eth0 parent 1:1 classid 1:3 htb rate 2000kbit ceil 2000kbit prio 1
./tc class add dev eth0 parent 1:1 classid 1:4 htb rate 10240kbit ceil 10240kbit prio 1
./tc class add dev eth0 parent 1:4 classid 1:41 htb rate 256kbit ceil 256kbit prio 2 burst 2kbit
./tc class add dev eth0 parent 1:4 classid 1:42 htb rate 512kbit ceil 512kbit prio 2 burst 2kbit
./tc class add dev eth0 parent 1:4 classid 1:43 htb rate 1024kbit ceil 1024kbit prio 2 burst 2kbit
./tc class add dev eth0 parent 1:4 classid 1:44 htb rate 2048kbit ceil 2048kbit prio 2 burst 2kbit
./tc class add dev eth0 parent 1:4 classid 1:45 htb rate 5120kbit ceil 5120kbit prio 2 burst 2kbit
./tc class add dev eth0 parent 1:4 classid 1:46 htb rate 10240kbit ceil 10240kbit prio 2 burst 2kbit
# eth1 (external :o)
./tc qdisc add dev eth1 root handle 2: htb default 41
./tc class add dev eth1 parent 2: classid 2:1 htb rate 10000kbit ceil 10000kbit
./tc class add dev eth1 parent 2:1 classid 2:2 htb rate 2000kbit ceil 2000kbit prio 1
./tc class add dev eth1 parent 2:1 classid 2:3 htb rate 2000kbit ceil 2000kbit prio 1
./tc class add dev eth1 parent 2:1 classid 2:4 htb rate 10240kbit ceil 10240kbit prio 1
./tc class add dev eth1 parent 2:4 classid 2:41 htb rate 256kbit ceil 256kbit prio 2 burst 2kbit
./tc class add dev eth1 parent 2:4 classid 2:42 htb rate 512kbit ceil 512kbit prio 2 burst 2kbit
./tc class add dev eth1 parent 2:4 classid 2:43 htb rate 1024kbit ceil 1024kbit prio 2 burst 2kbit
./tc class add dev eth1 parent 2:4 classid 2:44 htb rate 2048kbit ceil 2048kbit prio 2 burst 2kbit
./tc class add dev eth1 parent 2:4 classid 2:45 htb rate 5120kbit ceil 5120kbit prio 2 burst 2kbit
./tc class add dev eth1 parent 2:4 classid 2:46 htb rate 10240kbit ceil 10240kbit prio 2 burst 2kbit
# filters
./tc filter add dev eth0 parent 1: protocol ip prio 1 handle 0x12 fw classid 1:2
./tc filter add dev eth0 parent 1: protocol ip prio 1 handle 0x13 fw classid 1:3
./tc filter add dev eth0 parent 1: protocol ip prio 1 handle 0x141 fw classid 1:41
./tc filter add dev eth0 parent 1: protocol ip prio 1 handle 0x142 fw classid 1:42
./tc filter add dev eth0 parent 1: protocol ip prio 1 handle 0x143 fw classid 1:43
./tc filter add dev eth0 parent 1: protocol ip prio 1 handle 0x144 fw classid 1:44
./tc filter add dev eth0 parent 1: protocol ip prio 1 handle 0x145 fw classid 1:45
./tc filter add dev eth0 parent 1: protocol ip prio 1 handle 0x146 fw classid 1:46
./tc filter add dev eth1 parent 2: protocol ip prio 1 handle 0x22 fw classid 2:2
./tc filter add dev eth1 parent 2: protocol ip prio 1 handle 0x23 fw classid 2:3
./tc filter add dev eth1 parent 2: protocol ip prio 1 handle 0x241 fw classid 2:41
./tc filter add dev eth1 parent 2: protocol ip prio 1 handle 0x242 fw classid 2:42
./tc filter add dev eth1 parent 2: protocol ip prio 1 handle 0x243 fw classid 2:43
./tc filter add dev eth1 parent 2: protocol ip prio 1 handle 0x244 fw classid 2:44
./tc filter add dev eth1 parent 2: protocol ip prio 1 handle 0x245 fw classid 2:45
./tc filter add dev eth1 parent 2: protocol ip prio 1 handle 0x246 fw classid 2:46
I put ebtables rules:
Code:
# ebtables -A FORWARD -p ipv4 -o eth1 --ip-destination 193.xx.yy.107 -j mark --set-mark 0x143 --mark-target ACCEPT
# ebtables -A FORWARD -p ipv4 -i eth0 --ip-source 193.xx.yy.107 -j mark --set-mark 0x143 --mark-target ACCEPT
How can we limit the ip 193.xx.yy.107 ? All the packet traffic cross througt the defaut (default 41).
I think this is a problem of packet MARKing, but don't really found the problem
as the ebtables is same as iptables but ebtables is using on bridge machine u can use "-t mange -A PREROUTING" chain to mark packets no in forward because forward is in routing proces and htb will ingnore your marks !
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.