lua-users home
lua-l archive

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


MAC is someting ethernet specific, not every network interface has to
have one. Correct me if I'm wrong, but why should a PPP-connection
have a mac adress anyway? Its a point-to-point connection, no need to
address something on Layer 2 in the OSI Modell where Mac belongs to.

Also not every computer must have a "default network interface", what
if you are not connected to the internet and thus not have a default
route? Or you are part of the backbone? (unlikely but possible :-)

I wonder what the usecase is that warrents wanting to know "mac of the
default network interface"?

On Sun, Feb 13, 2011 at 11:18 AM, Andrew Cannon <ajc@gmx.net> wrote:
> Jeff Pohlmeyer wrote:
>> On Sat, Feb 12, 2011 at 11:43 PM, Leo Razoumov wrote:
>>
>>> On Sat, Feb 12, 2011 at 23:44, Thomas Harning Jr. wrote:
>>>> Let alone a way to define "default network interface".  Or is there?
>>>> Say I have 2 NICs, which one is default?
>>
>>> The one which is associated with a default route is a default interface.
>>> On Linux one can get it via "route -n". From Lua one can use
>>> os.popen("route -n") and then parse the line with 0.0.0.0 destination
>>> (default route) and extract the corresponding interface name.
>>
>> I am using pppoe on my machine and "route" tells me 0.0.0.0
>> is ppp0, but that still doesn't tell me which NIC is ppp0
>> associated with.
>>
>>  - Jeff
>>
>
> for that you need 'ifconfig ppp0'
>
> - Andrew
>
>
>
>
>