LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-10-2014, 06:00 AM   #1
TeaYoung
LQ Newbie
 
Registered: Apr 2013
Posts: 26

Rep: Reputation: Disabled
[udev] Specific network is I want to know whether or wired is wireless.


Hello.

I is specific network interface you want to know whether or wired is wireless.

For example, eth0 is I want to know whether or wired is wireless.

I I'd want to do this to udev. So I saw the eth0 and eth1 to udevadm.

Quote:
root@test:~# udevadm info -a -p /sys/class/net/eth0

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

looking at device '/devices/virtual/net/eth0':
KERNEL=="eth0"
SUBSYSTEM=="net"
DRIVER==""
ATTR{mtu}=="1500"
ATTR{type}=="1"
ATTR{netdev_group}=="0"
ATTR{flags}=="0x1003"
ATTR{dormant}=="0"
ATTR{addr_assign_type}=="0"
ATTR{dev_id}=="0x0"
ATTR{iflink}=="2"
ATTR{addr_len}=="6"
ATTR{address}=="00:15:1d:00:00:00"
ATTR{operstate}=="up"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{tx_queue_len}=="1000"
ATTR{ifalias}==""
ATTR{ifindex}=="2"
ATTR{link_mode}=="0"
ATTR{carrier}=="1"

root@test:~#

Quote:
root@test:~# udevadm info -a -p /sys/class/net/eth1

Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.

looking at device '/devices/platform/exynos4-sdhci.3/mmc_host/mmc1/mmc1:0001/mmc1:0001:1/net/eth1':
KERNEL=="eth1"
SUBSYSTEM=="net"
DRIVER==""
ATTR{mtu}=="1500"
ATTR{type}=="1"
ATTR{netdev_group}=="0"
ATTR{flags}=="0x1002"
ATTR{addr_assign_type}=="0"
ATTR{dev_id}=="0x0"
ATTR{iflink}=="3"
ATTR{addr_len}=="6"
ATTR{address}=="c4:23:7a:00:6e:93"
ATTR{operstate}=="down"
ATTR{broadcast}=="ff:ff:ff:ff:ff:ff"
ATTR{tx_queue_len}=="1000"
ATTR{ifalias}==""
ATTR{ifindex}=="3"
ATTR{link_mode}=="0"

looking at parent device '/devices/platform/exynos4-sdhci.3/mmc_host/mmc1/mmc1:0001/mmc1:0001:1':
KERNELS=="mmc1:0001:1"
SUBSYSTEMS=="sdio"
DRIVERS=="unifi"
ATTRS{class}=="0x00"
ATTRS{device}=="0x0007"
ATTRS{vendor}=="0x032a"

looking at parent device '/devices/platform/exynos4-sdhci.3/mmc_host/mmc1/mmc1:0001':
KERNELS=="mmc1:0001"
SUBSYSTEMS=="mmc"
DRIVERS==""
ATTRS{type}=="SDIO"

looking at parent device '/devices/platform/exynos4-sdhci.3/mmc_host/mmc1':
KERNELS=="mmc1"
SUBSYSTEMS=="mmc_host"
DRIVERS==""

looking at parent device '/devices/platform/exynos4-sdhci.3':
KERNELS=="exynos4-sdhci.3"
SUBSYSTEMS=="platform"
DRIVERS=="s3c-sdhci"

looking at parent device '/devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""

root@test:~#
In my opinion, I think that it can be determined to have the ATTR {flags}.

ATTR {flags} is in the wireless if 0x1002, if it is 0x1003, you have a guess and wired.

My thinking is that correct?

Is the information for the flags can be found where?

how corresponding interface without knowing to have you need to determine whether a wireless or a wired the flags?
 
Old 12-09-2014, 08:43 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
No, the difference between the flags here only tell you that one of your interfaces is up and the other is down.

You will find documentation for the net subsystem at kernel.org. And documentation specifically for the net flags in the source.

You can tell which interface is which by getting the hardware address using ipconfig or
Code:
ip a
And determine the matching hardware using
Code:
lshw -class network
From the udev perspective, many drivers assign wireless interfaces to names like "wlan0" rather than "eth0", so that other rules can then wildcard match on the name "wlan*". But this is not consistent between drivers. You can manually override these on a particular system by editing the "NAME" parameters in "/usr/dev/rules.d/70-persistent-net-rules".
 
1 members found this post helpful.
  


Reply


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
connect to two network interfaces, wireless and wired in order to share wireless pbutts Linux - Networking 13 03-05-2014 09:23 AM
bridging a wireless and wired network causes wired to stop working royce2020 Linux - Networking 0 04-21-2009 05:48 PM
wireless network or wired rich345 Linux - Laptop and Netbook 1 12-07-2008 09:59 AM
Bridging a wired network to a (managed by network manager) wireless one jemenake Linux - Wireless Networking 2 09-09-2008 10:18 PM
Network Manager issue : Does not distinguish between wired and wireless network rohanak Linux - Laptop and Netbook 1 09-04-2008 05:49 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:23 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
Open Source Consulting | Domain Registration