0

I'm trying to limit the bandwidth between my eth0 output (nginx proxy) to my loopback inteface (apache) by filtering on destination port.

Incoming Packet -> Eth0 -> 0.0.0.0:80 Nginx -> tc qdisc class/iptable mangle 2525port -> 127.0.0.1:2525 Apache

I don't know if it's even possible I'm just experimenting.

My rules are the followings :

tc qdisc add dev eth0 root handle 1:0 htb
tc class add dev eth0 parent 1:0 classid 1:10 htb rate 2mbps ceil 2mbps prio 0
tc filter add dev eth0 parent 1:0 prio 0 protocol ip handle 10 fw flowid 1:10

iptables -A OUTPUT -t mangle -p tcp --dport 2525 -j MARK --set-mark 10

I also tried to with FORWARD chain but its still the same.

Arka
  • 173
  • 1
  • 2
  • 8
  • You have an fundamental misunderstanding. Nginx will use the loopback interface to connect to Apache. – Andrew Jun 01 '14 at 04:30
  • Yes I realised that and corrected my configuration, it's now working well on loopback. – Arka Jun 02 '14 at 19:50

1 Answers1

0

As Andrew mentionned I was wrong by thinking that I should filter the eth0. As soon as I changed the configuration to loopback instead of eth0 everything worked fine.

Arka
  • 173
  • 1
  • 2
  • 8