Re: [iproute2] tc action mirred question

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Xiaofei Wu
Date: Monday, September 14, 2009 - 6:44 am

>> 



I did two expriments. One is OK. The result of the other is not the same as I expected. I don't know why.

(1)
 A
| |
 C

A: eth0  192.168.1.242/24
   wlan1 192.168.4.5/24

C: wlan1 192.168.4.202/24
   eth0  192.168.1.215/24
On node A, I mirrored packets to wlan1(eth0 -> wlan1), modified dst,src MAC (transmit to wlan1 of node C).
When I run 'ping 192.168.1.215' on node A, one request will get two replies. It's OK.

(2)
 A
/ |
B |
\ |
 C

A: eth0  192.168.1.242/24
   wlan1 192.168.2.5/24

B: wlan1 192.168.2.11/24
   wlan2 192.168.4.11/24

C: wlan1 192.168.4.202/24
   eth0  192.168.1.215/24

On node A, I run this to mirror, pedit packets.
---
#tc qdisc add dev eth0 handle 1: root prio
#tc filter add dev eth0 parent 1: protocol ip prio 10 u32 \
match ip src 192.168.1.0/24 flowid 1:16 \
action mirred egress mirror dev wlan1

#tc qdisc add dev wlan1 handle 1: root prio
#tc filter add dev wlan1 parent 1: protocol ip prio 10 u32 \
match ip src 192.168.1.0/24 flowid 1:16 \
action pedit munge offset -14 u16 set 0x0023 \
munge offset -12 u32 set 0xcdafecda \
munge offset -8 u32 set 0x0023cdaf \
munge offset -4 u32 set 0xd0740800
---

the routing table 0f node B
---
#route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.4.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan2
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan1
0.0.0.0         192.168.4.202     0.0.0.0       UG    0      0        0 wlan2

#cat /proc/sys/net/ipv4/ip_forward
1
---

On node A I run 'ping 192.168.1.215'(IP addr of node C eth0) on node A, one request 'only' get one reply. It's strange.
On node B,
window1:  'tcpdump -i wlan1 -n -e', I can see the mirroring packets.
window2:  'tcpdump -i wlan2 -n -e', I see noting.
It seems that node B didn't forward the mirroring packects. So I did anotner experiment to check it. 
I am sure node B can forward packets. But it didn't forward the mirroring packets, why?  (something wrong with the mirroring packets?)



regards,
wu


      

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [iproute2] tc action mirred question, Xiaofei Wu, (Mon Sep 7, 9:05 am)
Re: [iproute2] tc action mirred question, jamal, (Mon Sep 7, 7:16 pm)
Re: [iproute2] tc action mirred question, thomas yang, (Tue Sep 8, 6:50 am)
Re: [iproute2] tc action mirred question, jamal, (Tue Sep 8, 7:10 am)
Re: [iproute2] tc action mirred question, thomas yang, (Tue Sep 8, 7:35 am)
Re: [iproute2] tc action mirred question, Xiaofei Wu, (Wed Sep 9, 6:12 am)
Re: [iproute2] tc action mirred question, jamal, (Wed Sep 9, 3:11 pm)
Re: [iproute2] tc action mirred question, Xiaofei Wu, (Wed Sep 9, 11:06 pm)
Re: [iproute2] tc action mirred question, jamal, (Fri Sep 11, 5:25 am)
Re: [iproute2] tc action mirred question, Xiaofei Wu, (Fri Sep 11, 11:45 am)
Re: [iproute2] tc action mirred question, jamal, (Fri Sep 11, 2:28 pm)
Re: [iproute2] tc action mirred question, Xiaofei Wu, (Sat Sep 12, 9:01 am)
Re: [iproute2] tc action mirred question, jamal, (Sat Sep 12, 2:49 pm)
Re: [iproute2] tc action mirred question, Xiaofei Wu, (Mon Sep 14, 6:44 am)
Re: [iproute2] tc action mirred question, jamal, (Wed Sep 16, 5:28 am)
Re: [iproute2] tc action mirred question, Xiaofei Wu, (Sun Sep 20, 2:58 am)
Re: [iproute2] tc action mirred question, jamal, (Sun Sep 20, 6:33 am)