I am trying to forward UDP traffic to/from a specific IP to a pseudo-interface:
iptables -I FORWARD -s [WAN-IP] -p udp -j ifb0
I have also tried (without success):
iptables -A OUTPUT -d [WAN-IP] -p udp -j ifb0
I am trying to redirect and apply latency to the traffic, what I have:
ip link set dev ifb0 up
echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -A FORWARD -p udp -i eth0 -o ifb0 -j ACCEPT
iptables -A FORWARD -p udp -i eth0 -o ifb0 -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -t nat -A POSTROUTING -o ifb0 -j MASQUERADE
tc qdisc add dev ifb0 root netem delay 100ms
Network information:
ip route
default via 195.***.***.*** dev pppoe-wan proto static
192.168.1.0/24 dev br-lan proto kernel scope link src 192.168.1.1
[195.***.***.***] dev pppoe-wan proto kernel scope link src **.***.***.***
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 195.***.***.*** 0.0.0.0 UG 0 0 0 pppoe-wan
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br-lan
195.***.***.*** 0.0.0.0 255.255.255.255 UH 0 0 0 pppoe-wan
ifconfig
br-lan Link encap:Ethernet HWaddr 30:B5:C2:D7:**:**
inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fda5:a926:****::1/60 Scope:Global
inet6 addr: fe80::32b5:c2ff:fed7:****/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3924668 errors:0 dropped:5 overruns:0 frame:0
TX packets:6856064 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:285489896 (272.2 MiB) TX bytes:9801376990 (9.1 GiB)
eth0 Link encap:Ethernet HWaddr 30:B5:C2:D7:**:**
inet6 addr: fe80::32b5:c2ff:fed7:****/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6817769 errors:0 dropped:0 overruns:0 frame:0
TX packets:3926298 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1243564002 (1.1 GiB) TX bytes:353441588 (337.0 MiB)
Interrupt:4
eth1 Link encap:Ethernet HWaddr 30:B5:C2:D7:**:**
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3922867 errors:0 dropped:68 overruns:0 frame:0
TX packets:6805869 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:340296313 (324.5 MiB) TX bytes:1166540824 (1.0 GiB)
Interrupt:5
ifb0 Link encap:Ethernet HWaddr 2E:13:67:**:**:**
inet6 addr: fe80::2c13:67ff:****:9593/64 Scope:Link
UP BROADCAST RUNNING NOARP MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:32
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:292 errors:0 dropped:0 overruns:0 frame:0
TX packets:292 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:21661 (21.1 KiB) TX bytes:21661 (21.1 KiB)
pppoe-wan Link encap:Point-to-Point Protocol
inet addr:**.***.***.*** P-t-P:195.***.***.*** Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1492 Metric:1
RX packets:6801543 errors:0 dropped:0 overruns:0 frame:0
TX packets:3909873 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:3
RX bytes:9682888295 (9.0 GiB) TX bytes:266900462 (254.5 MiB)
Nothing happens.