reroute icmp traffic from one interface to another

Linux Advanced Routing and Traffic Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hello,
I have an openwrt firmware installed in my router and I want to configure a Home and a Guest interface. So I have two internal interfaces(home,guest) and the external(eth1). First I have to send all traffic from the two internal interfaces(wlan0,wlan0-1) to external(eth1). With my project I have to measure latency so I use nping. However when I use the command "sudo nping -c 3200 --data-length 1460 x.x.x.x" with network seted to upload bandiwidth 2Mbps and with data length 1460 B (1460*8=11740) we expect minimum delay 11740/2000000=5.8ms . Nonetheless, the avg ping time is about 0.8-3 ms which means that my iptables commands doesn't work properly for the ping traffic (icmp type). Do you know how I can route this traffic with the tcp one? I'm pretty sure that icmp traffic is enqueued because when the home user is uploading a file nping command takes out the proper delay.

Thank you in advance,
Chatzistyli Ilia

My code is:

#!/bin/sh /etc/rc.common
# Copyright (C) 2006 OpenWrt.org

echo "Starting bandwidth shaping"
IPT=/usr/sbin/iptables
IF=eth1
#interface home user
IFHU=wlan0
#interface guest user
IFGU=wlan0-1
IP="$(ifconfig eth1 | grep "inet addr" | cut -d ':' -f 2 | cut -d ' ' -f 1)" # IP eth1 Interface
IPHU=192.168.5.1
IPGU=192.168.3.1



$IPT -t filter -F
$IPT -t filter -X
$IPT -t nat -F
$IPT -t nat -X
$IPT -t mangle -F
$IPT -t mangle -X
$IPT -t raw -F
$IPT -t raw -X
# Default Policies fuer integrierte Ketten festlegen:

$IPT -t nat -P PREROUTING ACCEPT
$IPT -t nat -P POSTROUTING ACCEPT
$IPT -t nat -P OUTPUT ACCEPT
$IPT -t filter -P INPUT ACCEPT
$IPT -t filter -P FORWARD ACCEPT
$IPT -t filter -P OUTPUT ACCEPT

#----------send wlan0-1 & wlan0 to eth1
        echo "iptables interface traffic redirect"
        iptables -t nat -A POSTROUTING --out-interface $IF -j MASQUERADE
        iptables -A FORWARD --in-interface $IFHU -j CLASSIFY --set-class 2:1
        iptables -A FORWARD --in-interface $IFGU -j CLASSIFY --set-class 2:2
#here i tryed to add -p icmp --icmp-type any etc or -p any but still had the same problem.
        echo "end of iptables"

#--------------------------------------

--
To unsubscribe from this list: send the line "unsubscribe lartc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [LARTC Home Page]     [Netfilter]     [Netfilter Development]     [Network Development]     [Bugtraq]     [GCC Help]     [Yosemite News]     [Linux Kernel]     [Fedora Users]
  Powered by Linux