How to determine what hardware is associated with what network interface











up vote
0
down vote

favorite












I have an inbuilt network card and a Wi-Fi dongle.



I use wpa_supplicant, hostapd and the likes to operate them.



The trouble is that sometimes the dongle is wlan0, and sometimes it is wlan1 (likewise for the inbuilt network card of course): so I never know whether "wlan0" is the dongle or the inbuilt card. The association wlanX <-> hardware appears completely random to me.



What is the command line to see, for a specific interface (wlan0 for instance), what hardware it corresponds to?



Alternatively, how to make sure a specific hardware (the dongle say) is always designated by a same interface (wlan0 say)?



Not being able to discriminate between these two hardware is a real problem because my dongle does not support the AP mode for instance.










share|improve this question









New contributor




hartmut is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • This solved it for me (on Raspbian Stretch): raspberrypi.org/forums/viewtopic.php?f=36&t=198946. More tricky that it seems.
    – hartmut
    Dec 3 at 10:57















up vote
0
down vote

favorite












I have an inbuilt network card and a Wi-Fi dongle.



I use wpa_supplicant, hostapd and the likes to operate them.



The trouble is that sometimes the dongle is wlan0, and sometimes it is wlan1 (likewise for the inbuilt network card of course): so I never know whether "wlan0" is the dongle or the inbuilt card. The association wlanX <-> hardware appears completely random to me.



What is the command line to see, for a specific interface (wlan0 for instance), what hardware it corresponds to?



Alternatively, how to make sure a specific hardware (the dongle say) is always designated by a same interface (wlan0 say)?



Not being able to discriminate between these two hardware is a real problem because my dongle does not support the AP mode for instance.










share|improve this question









New contributor




hartmut is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.




















  • This solved it for me (on Raspbian Stretch): raspberrypi.org/forums/viewtopic.php?f=36&t=198946. More tricky that it seems.
    – hartmut
    Dec 3 at 10:57













up vote
0
down vote

favorite









up vote
0
down vote

favorite











I have an inbuilt network card and a Wi-Fi dongle.



I use wpa_supplicant, hostapd and the likes to operate them.



The trouble is that sometimes the dongle is wlan0, and sometimes it is wlan1 (likewise for the inbuilt network card of course): so I never know whether "wlan0" is the dongle or the inbuilt card. The association wlanX <-> hardware appears completely random to me.



What is the command line to see, for a specific interface (wlan0 for instance), what hardware it corresponds to?



Alternatively, how to make sure a specific hardware (the dongle say) is always designated by a same interface (wlan0 say)?



Not being able to discriminate between these two hardware is a real problem because my dongle does not support the AP mode for instance.










share|improve this question









New contributor




hartmut is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











I have an inbuilt network card and a Wi-Fi dongle.



I use wpa_supplicant, hostapd and the likes to operate them.



The trouble is that sometimes the dongle is wlan0, and sometimes it is wlan1 (likewise for the inbuilt network card of course): so I never know whether "wlan0" is the dongle or the inbuilt card. The association wlanX <-> hardware appears completely random to me.



What is the command line to see, for a specific interface (wlan0 for instance), what hardware it corresponds to?



Alternatively, how to make sure a specific hardware (the dongle say) is always designated by a same interface (wlan0 say)?



Not being able to discriminate between these two hardware is a real problem because my dongle does not support the AP mode for instance.







networking command-line networkmanager hostapd






share|improve this question









New contributor




hartmut is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.











share|improve this question









New contributor




hartmut is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









share|improve this question




share|improve this question








edited Dec 3 at 7:35









G-Man

12.4k92961




12.4k92961






New contributor




hartmut is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.









asked Dec 3 at 7:16









hartmut

101




101




New contributor




hartmut is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.





New contributor





hartmut is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.






hartmut is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.












  • This solved it for me (on Raspbian Stretch): raspberrypi.org/forums/viewtopic.php?f=36&t=198946. More tricky that it seems.
    – hartmut
    Dec 3 at 10:57


















  • This solved it for me (on Raspbian Stretch): raspberrypi.org/forums/viewtopic.php?f=36&t=198946. More tricky that it seems.
    – hartmut
    Dec 3 at 10:57
















This solved it for me (on Raspbian Stretch): raspberrypi.org/forums/viewtopic.php?f=36&t=198946. More tricky that it seems.
– hartmut
Dec 3 at 10:57




This solved it for me (on Raspbian Stretch): raspberrypi.org/forums/viewtopic.php?f=36&t=198946. More tricky that it seems.
– hartmut
Dec 3 at 10:57










1 Answer
1






active

oldest

votes

















up vote
1
down vote













The device names are "unstable" since the numbers are assigned on boot based on whichever device answers first during enumeration. As you observed, depending on the hardware set-up, this may be random.



You should consider enabling systemd's persistent network interfaces. Alternatively, you can manually configure udev to assign a custom device name via
70-persistent-net.rules



As for configuring the network itself, using netplan may (in case you use Ubuntu 17.04 or newer) applicable, too. The access point's interface is usually either part of a bridge (network level 2) or statically configured (network level 3, client's data needs to be routed). According to the examples, a static configuration with netplan looks like this:



network:
version: 2
renderer: networkd
wifis:
wlp2s0b1:
dhcp4: no
dhcp6: no
addresses: [192.168.1.1/24]





share|improve this answer























  • Thanks! Could you explicit the last paragraph please?
    – hartmut
    Dec 3 at 8:34










  • @hartmut Yes. I extended the answer. Please note that I did not test this exact configuration myself.
    – Hermann
    2 days ago











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});






hartmut is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485619%2fhow-to-determine-what-hardware-is-associated-with-what-network-interface%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote













The device names are "unstable" since the numbers are assigned on boot based on whichever device answers first during enumeration. As you observed, depending on the hardware set-up, this may be random.



You should consider enabling systemd's persistent network interfaces. Alternatively, you can manually configure udev to assign a custom device name via
70-persistent-net.rules



As for configuring the network itself, using netplan may (in case you use Ubuntu 17.04 or newer) applicable, too. The access point's interface is usually either part of a bridge (network level 2) or statically configured (network level 3, client's data needs to be routed). According to the examples, a static configuration with netplan looks like this:



network:
version: 2
renderer: networkd
wifis:
wlp2s0b1:
dhcp4: no
dhcp6: no
addresses: [192.168.1.1/24]





share|improve this answer























  • Thanks! Could you explicit the last paragraph please?
    – hartmut
    Dec 3 at 8:34










  • @hartmut Yes. I extended the answer. Please note that I did not test this exact configuration myself.
    – Hermann
    2 days ago















up vote
1
down vote













The device names are "unstable" since the numbers are assigned on boot based on whichever device answers first during enumeration. As you observed, depending on the hardware set-up, this may be random.



You should consider enabling systemd's persistent network interfaces. Alternatively, you can manually configure udev to assign a custom device name via
70-persistent-net.rules



As for configuring the network itself, using netplan may (in case you use Ubuntu 17.04 or newer) applicable, too. The access point's interface is usually either part of a bridge (network level 2) or statically configured (network level 3, client's data needs to be routed). According to the examples, a static configuration with netplan looks like this:



network:
version: 2
renderer: networkd
wifis:
wlp2s0b1:
dhcp4: no
dhcp6: no
addresses: [192.168.1.1/24]





share|improve this answer























  • Thanks! Could you explicit the last paragraph please?
    – hartmut
    Dec 3 at 8:34










  • @hartmut Yes. I extended the answer. Please note that I did not test this exact configuration myself.
    – Hermann
    2 days ago













up vote
1
down vote










up vote
1
down vote









The device names are "unstable" since the numbers are assigned on boot based on whichever device answers first during enumeration. As you observed, depending on the hardware set-up, this may be random.



You should consider enabling systemd's persistent network interfaces. Alternatively, you can manually configure udev to assign a custom device name via
70-persistent-net.rules



As for configuring the network itself, using netplan may (in case you use Ubuntu 17.04 or newer) applicable, too. The access point's interface is usually either part of a bridge (network level 2) or statically configured (network level 3, client's data needs to be routed). According to the examples, a static configuration with netplan looks like this:



network:
version: 2
renderer: networkd
wifis:
wlp2s0b1:
dhcp4: no
dhcp6: no
addresses: [192.168.1.1/24]





share|improve this answer














The device names are "unstable" since the numbers are assigned on boot based on whichever device answers first during enumeration. As you observed, depending on the hardware set-up, this may be random.



You should consider enabling systemd's persistent network interfaces. Alternatively, you can manually configure udev to assign a custom device name via
70-persistent-net.rules



As for configuring the network itself, using netplan may (in case you use Ubuntu 17.04 or newer) applicable, too. The access point's interface is usually either part of a bridge (network level 2) or statically configured (network level 3, client's data needs to be routed). According to the examples, a static configuration with netplan looks like this:



network:
version: 2
renderer: networkd
wifis:
wlp2s0b1:
dhcp4: no
dhcp6: no
addresses: [192.168.1.1/24]






share|improve this answer














share|improve this answer



share|improve this answer








edited 2 days ago

























answered Dec 3 at 7:31









Hermann

598313




598313












  • Thanks! Could you explicit the last paragraph please?
    – hartmut
    Dec 3 at 8:34










  • @hartmut Yes. I extended the answer. Please note that I did not test this exact configuration myself.
    – Hermann
    2 days ago


















  • Thanks! Could you explicit the last paragraph please?
    – hartmut
    Dec 3 at 8:34










  • @hartmut Yes. I extended the answer. Please note that I did not test this exact configuration myself.
    – Hermann
    2 days ago
















Thanks! Could you explicit the last paragraph please?
– hartmut
Dec 3 at 8:34




Thanks! Could you explicit the last paragraph please?
– hartmut
Dec 3 at 8:34












@hartmut Yes. I extended the answer. Please note that I did not test this exact configuration myself.
– Hermann
2 days ago




@hartmut Yes. I extended the answer. Please note that I did not test this exact configuration myself.
– Hermann
2 days ago










hartmut is a new contributor. Be nice, and check out our Code of Conduct.










draft saved

draft discarded


















hartmut is a new contributor. Be nice, and check out our Code of Conduct.













hartmut is a new contributor. Be nice, and check out our Code of Conduct.












hartmut is a new contributor. Be nice, and check out our Code of Conduct.
















Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.





Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


Please pay close attention to the following guidance:


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f485619%2fhow-to-determine-what-hardware-is-associated-with-what-network-interface%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

サソリ

広島県道265号伴広島線

Accessing regular linux commands in Huawei's Dopra Linux