Identify eth interface used by each pppoe link
Hi! This is my first post :cool:
I'm developing a C API for gathering network info from my home made router (3 WAN + 1 LAN). My ISPs provide connection through PPPoE and DHCP. For each ppp connection i need to identify the ethernet interface used. Is it possible? I'm using Gentoo 2006.1 with kernel 2.6.17-gentoo-r8 and my pppoe client is rp-pppoe. I'll post more info if requested. Thanks in advance. |
couldn't you identify them by MAC address??
|
Thanks for your reply :)
It sounds like a good idea, but it seems i'm lacking the hw address on ppp interfaces. Does ppp links have hw addresses like 'real' interfaces (eth)? This is what one of my ppp interfaces looks like: Code:
porteiro ~ # ip link l ppp0 Code:
porteiro ~ # ip link l eth0 Do you have hw address on ppp links? I can't really find info on how to do this. |
Quote:
|
The equivalent is /etc/conf.d/net, which I configured like this:
Code:
config_eth0=( "null" ) Code:
for interface in $INTERFACES; do Code:
/usr/sbin/pppoe-start pppoe_eth0.conf So, after the init script I could have this association: ppp0 -> eth0 eth1 -> eth1 ppp1 -> eth2 Due to instability, ppp links go down, and when they return the association could look like this: ppp1 -> eth0 eth1 -> eth1 ppp0 -> eth2 And this is a problem to me :scratch: Is there a way to ask the kernel for this?nelink sockets? I've already looked at /proc/sys/net/ipv4/conf/ppp*/ but I couldn't extract nothing useful. |
Are YOU able to output the complete hardware listing of YOUR system? One that shows all YOUR devices and the associated IRQ's. Try using "lspci" "lsusb" and "modprobe". Gentoo has specific applications, but something like "Ethtool" may be the way to proceed. On my system, I can use Yast to "see" all the items, line by line. Also, try "ifconfig" for the current output. Good luck.
|
Hi. thanks for the reply.
After a long search I found a way to solve my problem. It's not pretty :) but it works. I've changed the way pppd names it's pids when called by pppoe. Now the pid name has the ethernet name appended. Because each pid file has inside the name of the ppp link I can now associate Ethernet interface and PPP link. Great! Of course I would like to do this differently. Maybe asking the kernel for this. But I never found how do it so I'm using this pid's trick. |
All times are GMT -5. The time now is 10:50 PM. |