LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices



Reply
 
Search this Thread
Old 02-14-2007, 08:50 AM   #1
noisebleed
Member
 
Registered: Feb 2007
Location: Porto, Portugal
Distribution: Gentoo
Posts: 41

Rep: Reputation: 15
Identify eth interface used by each pppoe link


Hi! This is my first post

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.
 
Old 02-16-2007, 05:38 AM   #2
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
couldn't you identify them by MAC address??
 
Old 02-16-2007, 07:08 PM   #3
noisebleed
Member
 
Registered: Feb 2007
Location: Porto, Portugal
Distribution: Gentoo
Posts: 41

Original Poster
Rep: Reputation: 15
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
71: ppp0: <POINTOPOINT,MULTICAST,NOARP,UP,10000> mtu 1492 qdisc htb qlen 3
    link/ppp
And this is my eth0 interface:

Code:
porteiro ~ # ip link l eth0
1: eth0: <BROADCAST,MULTICAST,UP,10000> mtu 1500 qdisc pfifo_fast qlen 1000
    link/ether 00:80:c8:f8:45:1f brd ff:ff:ff:ff:ff:ff
As you can see no mac address on ppp.

Do you have hw address on ppp links?

I can't really find info on how to do this.
 
Old 02-16-2007, 10:06 PM   #4
win32sux
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Quote:
Originally Posted by noisebleed
Do you have hw address on ppp links?
not really... the mac address concept is for ethernet... but since you are doing PPPoE i figured you might somehow be able to extract the MAC from the ethernet frames which your PPP streams are getting encapsulated in... i'm not sure how to do that, and i would actually be surprised if there wasn't some other way to do what you want... what does your /etc/network/interfaces file (or equivalent) look like??
 
Old 02-17-2007, 11:34 AM   #5
noisebleed
Member
 
Registered: Feb 2007
Location: Porto, Portugal
Distribution: Gentoo
Posts: 41

Original Poster
Rep: Reputation: 15
The equivalent is /etc/conf.d/net, which I configured like this:
Code:
config_eth0=( "null" )
config_eth1=( "null" )
config_eth2=( "null" )
config_eth3=( "null" )
Nothing is done here because I've made my own init script where I start all my services and network interfaces. Somewhere in the file I have:
Code:
for interface in $INTERFACES; do
  /etc/myrouter/conf/init.${interface}
done
And for instance, on init.eth0, I could have:
Code:
/usr/sbin/pppoe-start pppoe_eth0.conf
and so on.

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

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.

Last edited by noisebleed; 02-18-2007 at 10:24 AM.
 
Old 04-16-2007, 07:30 PM   #6
UhhMaybe
Member
 
Registered: Jul 2004
Location: Salt Lake City, Utah
Distribution: Absolute 12.0 Studio 64 1.3.0
Posts: 470

Rep: Reputation: 30
Cool

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.
 
Old 04-19-2007, 05:59 AM   #7
noisebleed
Member
 
Registered: Feb 2007
Location: Porto, Portugal
Distribution: Gentoo
Posts: 41

Original Poster
Rep: Reputation: 15
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.

Last edited by noisebleed; 04-19-2007 at 06:50 AM.
 
  


Reply

Tags
ethernet, gentoo, pppoe, router


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Rpad - a web interface to identify() ? StargateSteve Programming 2 12-14-2006 02:04 PM
Packets just don't reach eth interface g00nie Linux - Networking 2 02-17-2006 10:11 AM
v-noob: connecting two pc's through eth interface garba Linux - Networking 3 06-14-2005 08:12 AM
How to bring eth interface up correctly? cold Linux - Networking 2 06-18-2004 03:40 AM
multiple ip address for single eth interface blackhound Linux - Networking 2 02-25-2004 07:02 AM


All times are GMT -5. The time now is 07:18 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration