OpenWrt Forum Archive

Topic: [x86][trunc] lan traffic visible on the wan interface

The content of this topic has been archived on 4 May 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

this has changed since 10.3
Previously when I had ppp0 interface on my usb modem the tcpdump -i ppp0 never showed any lan traffic, now I have 3g-wan interface instead of the ppp0 attached to wan zone and now I see the lan traffic

root@Alix:~# tcpdump -i 3g-wan
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on br-lan, link-type EN10MB (Ethernet), capture size 96 bytes
23:24:18.887695 IP alix.lan.22 > My-Home.lan.1049: Flags [P.], ack 1672505292, win 860, length 192
23:24:18.887842 IP My-Home.lan.1049 > alix.lan.22: Flags [.], ack 192, win 36344, length 0
23:24:18.897422 IP alix.lan.22 > My-Home.lan.1049: Flags [P.], ack 1, win 860, length 240
23:24:18.907074 IP alix.lan.22 > My-Home.lan.1049: Flags [P.], ack 1, win 860, length 128

What the?

(Last edited by flux on 15 Jun 2010, 22:32)

listening on br-lan, link-type EN10MB (Ethernet), capture size 96 bytes

Looks like tcpdump has issues.

jow wrote:

listening on br-lan, link-type EN10MB (Ethernet), capture size 96 bytes

Looks like tcpdump has issues.

I'd say that something wrong with the 3g-wan interface.

root@Alix:~# tcpdump -i ath0
tcpdump: WARNING: ath0: no IPv4 address assigned
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on ath0, link-type EN10MB (Ethernet), capture size 96 bytes

Why should be something wrong with the interface? I'd rather say that tcpdump has some issue with its name.

jow wrote:

Why should be something wrong with the interface? I'd rather say that tcpdump has some issue with its name.

okok, something's wrong with the interface name. Is there any way to change it or set an alias?

Why it was necessary to change it anyway?

flux wrote:

Is there any way to change it or set an alias?

Edit /lib/network/3g.sh

flux wrote:

Why it was necessary to change it anyway?

To make interface names predictable.
Tracking the right pppX ifaces correctly was very hard and never worked 100% correctly, especially in setups where multiple pppd instances are involved (pptp, pppoe and 3g).

jow wrote:
flux wrote:

Is there any way to change it or set an alias?

Edit /lib/network/3g.sh

flux wrote:

Why it was necessary to change it anyway?

To make interface names predictable.
Tracking the right pppX ifaces correctly was very hard and never worked 100% correctly, especially in setups where multiple pppd instances are involved (pptp, pppoe and 3g).

I tested it. tcpdump works doesn't like this name. Most probably becase it begins with a number.
I also have issues with the led settings and this interface name. Disconnecting the modem does not switch off the led. Or the led never blinks sometimes. I have to change some setting and saveapply then it blinks. Never had issues with ppp0 name. Please fix this

hi jow
I noticed that you've added a patch for the tcpdump. Instead of patching the pppd script and simply invert the interface name so it doesn't start with a digit (like wan-3g) you've patched the tcpdump! Why is that? Have you analyzed why this restriction exist in the tcpdump code? Have you checked all other programs that could have similar restriction?

(Last edited by flux on 7 Jul 2010, 13:10)

flux wrote:

Why is that?

Easier.

flux wrote:

Have you analyzed why this restriction exist in the tcpdump code?

Yes. There is no restriction. They just run atoi() on the ifname and hope that it never starts with a number, its also commented above the offending code.

Have you checked all other programs that could have similar restriction?

Yeah, there are other programs with such issues but they fail for different reasons (e.g. do check for "wlan*", "eth*" and "lo" which will fails for "ath*", "br-*", "tun*", "tap*" - iptraf is one such candidate).

~ Jow

jow wrote:

Yes. There is no restriction. They just run atoi() on the ifname and hope that it never starts with a number, its also commented above the offending code.
~ Jow

ok, I see. I wasn't sure if there's no some kind of a standard interface naming conventions.

Btw, problem with leds still bothers me. I have this for one of my leds defined

config 'led'
        option 'name' '3g'
        option 'sysfs' 'alix:3'
        option 'trigger' 'netdev'
        option 'dev' '3g-wan'
        option 'mode' 'link tx rx'

I suppose the problem here's that this interface is added and removed dynamically and something gets screwed when I remove the usb stick and insert it again (the led never blinks again). Maybe luci shall allow adding custom defined interface names which is not possible now.

Would you comment on this?

Jow, thanks for the tcpdump patch. Personally I find the 3g-wan/ppp-wan convention very useful. It helps a lot when you always know what a device will be named.

flux wrote:

Would you comment on this?

no comments, no workarounds.

I have no idea regarding the led issue

The discussion might have continued from here.