How to use same interfaces settings for all wlan devices
I am working with a pcengines apu2c4 board with debian 8.4 installed.Obviously when you insert a wifi dongle new to the machine it is given wlan0, wlan1, wlan2 etc... Is there a way of making all future wifi devices use the same settings in /etc/network/interfaces instead of making a new section in interfaces every time a new adapter is plugged in?
debian usb network-interface bridge
add a comment |
I am working with a pcengines apu2c4 board with debian 8.4 installed.Obviously when you insert a wifi dongle new to the machine it is given wlan0, wlan1, wlan2 etc... Is there a way of making all future wifi devices use the same settings in /etc/network/interfaces instead of making a new section in interfaces every time a new adapter is plugged in?
debian usb network-interface bridge
add a comment |
I am working with a pcengines apu2c4 board with debian 8.4 installed.Obviously when you insert a wifi dongle new to the machine it is given wlan0, wlan1, wlan2 etc... Is there a way of making all future wifi devices use the same settings in /etc/network/interfaces instead of making a new section in interfaces every time a new adapter is plugged in?
debian usb network-interface bridge
I am working with a pcengines apu2c4 board with debian 8.4 installed.Obviously when you insert a wifi dongle new to the machine it is given wlan0, wlan1, wlan2 etc... Is there a way of making all future wifi devices use the same settings in /etc/network/interfaces instead of making a new section in interfaces every time a new adapter is plugged in?
debian usb network-interface bridge
debian usb network-interface bridge
edited Jan 6 at 21:27
Rui F Ribeiro
39.5k1479132
39.5k1479132
asked Apr 19 '16 at 10:27
Simon DunningSimon Dunning
5417
5417
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
If you want to share the same IP config/network between several interfaces configure bridging.
In Debian it should be something similar to this:
allow-hotplug wlan0
iface wlan0 inet manual
allow-hotplug wlan1
iface wlan1 inet manual
auto br0
iface br0 inet static
bridge_ports wlan0 wlan1
address 192.168.1.1
netmask 255.255.255.0
You also need to load the bonding kernel module.
Add to /etc/modules
bonding
Please read: Network Card Bonding and Bridging On CentOS and Debian
add a comment |
You probably have to have an entry in /etc/udev/rules/70-persistent-net.rules
that allocates the same wlan0
name to any wlan device that it detects.
e.g. On one of my systems, I have a TP-Link TL-WN721N that has the following rule:
# USB device 0x:0x (ath9k_htc) TP-Link TL-WN721N
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
If I wanted to turn that into a generic rule that matched any WLAN device, regardless of the MAC address etc, I'd comment out or delete that rule and replace it with something like this:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="wlan*", NAME="wlan0"
Note: This WILL cause you problems if you later find you need two wlan devices installed or otherwise need to distinguish between different wlan devices.
I just re-read your question. It seems like you might already have two wlan devices in the machine. I'm not sure if what you want is possible in that situation unless one of the devices is always the same (and has its own udev rule that comes before the generic rule) while the second device varies.
One possible method is to run something like sed -i -e '/wlan/d' /etc/udev/rules.d/70-persistent-net.rules
on every reboot or from a root shell (and remember to make udev
reload its config) before you swap the wlan usb adaptors. I know this works with eternet devices because I have to do something very similar whenever I replace a machine's motherboard or PCI-e ethernet card, or clone a system to new hardware.
Also Note: this works with a sysvinit
debian system. I have no idea if it works the same on a systemd
machine - the only systemd
machine I have doesn't have a wlan interface, only ethernet. and I really don't feel like messing with it's network config right now, it was hard enough getting systemd
to do what I wanted when I replaced its NIC (by replacing its motherboard) a few months ago.
add a comment |
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',
autoActivateHeartbeat: false,
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
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f277498%2fhow-to-use-same-interfaces-settings-for-all-wlan-devices%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
If you want to share the same IP config/network between several interfaces configure bridging.
In Debian it should be something similar to this:
allow-hotplug wlan0
iface wlan0 inet manual
allow-hotplug wlan1
iface wlan1 inet manual
auto br0
iface br0 inet static
bridge_ports wlan0 wlan1
address 192.168.1.1
netmask 255.255.255.0
You also need to load the bonding kernel module.
Add to /etc/modules
bonding
Please read: Network Card Bonding and Bridging On CentOS and Debian
add a comment |
If you want to share the same IP config/network between several interfaces configure bridging.
In Debian it should be something similar to this:
allow-hotplug wlan0
iface wlan0 inet manual
allow-hotplug wlan1
iface wlan1 inet manual
auto br0
iface br0 inet static
bridge_ports wlan0 wlan1
address 192.168.1.1
netmask 255.255.255.0
You also need to load the bonding kernel module.
Add to /etc/modules
bonding
Please read: Network Card Bonding and Bridging On CentOS and Debian
add a comment |
If you want to share the same IP config/network between several interfaces configure bridging.
In Debian it should be something similar to this:
allow-hotplug wlan0
iface wlan0 inet manual
allow-hotplug wlan1
iface wlan1 inet manual
auto br0
iface br0 inet static
bridge_ports wlan0 wlan1
address 192.168.1.1
netmask 255.255.255.0
You also need to load the bonding kernel module.
Add to /etc/modules
bonding
Please read: Network Card Bonding and Bridging On CentOS and Debian
If you want to share the same IP config/network between several interfaces configure bridging.
In Debian it should be something similar to this:
allow-hotplug wlan0
iface wlan0 inet manual
allow-hotplug wlan1
iface wlan1 inet manual
auto br0
iface br0 inet static
bridge_ports wlan0 wlan1
address 192.168.1.1
netmask 255.255.255.0
You also need to load the bonding kernel module.
Add to /etc/modules
bonding
Please read: Network Card Bonding and Bridging On CentOS and Debian
edited Apr 19 '16 at 11:39
answered Apr 19 '16 at 11:32
Rui F RibeiroRui F Ribeiro
39.5k1479132
39.5k1479132
add a comment |
add a comment |
You probably have to have an entry in /etc/udev/rules/70-persistent-net.rules
that allocates the same wlan0
name to any wlan device that it detects.
e.g. On one of my systems, I have a TP-Link TL-WN721N that has the following rule:
# USB device 0x:0x (ath9k_htc) TP-Link TL-WN721N
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
If I wanted to turn that into a generic rule that matched any WLAN device, regardless of the MAC address etc, I'd comment out or delete that rule and replace it with something like this:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="wlan*", NAME="wlan0"
Note: This WILL cause you problems if you later find you need two wlan devices installed or otherwise need to distinguish between different wlan devices.
I just re-read your question. It seems like you might already have two wlan devices in the machine. I'm not sure if what you want is possible in that situation unless one of the devices is always the same (and has its own udev rule that comes before the generic rule) while the second device varies.
One possible method is to run something like sed -i -e '/wlan/d' /etc/udev/rules.d/70-persistent-net.rules
on every reboot or from a root shell (and remember to make udev
reload its config) before you swap the wlan usb adaptors. I know this works with eternet devices because I have to do something very similar whenever I replace a machine's motherboard or PCI-e ethernet card, or clone a system to new hardware.
Also Note: this works with a sysvinit
debian system. I have no idea if it works the same on a systemd
machine - the only systemd
machine I have doesn't have a wlan interface, only ethernet. and I really don't feel like messing with it's network config right now, it was hard enough getting systemd
to do what I wanted when I replaced its NIC (by replacing its motherboard) a few months ago.
add a comment |
You probably have to have an entry in /etc/udev/rules/70-persistent-net.rules
that allocates the same wlan0
name to any wlan device that it detects.
e.g. On one of my systems, I have a TP-Link TL-WN721N that has the following rule:
# USB device 0x:0x (ath9k_htc) TP-Link TL-WN721N
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
If I wanted to turn that into a generic rule that matched any WLAN device, regardless of the MAC address etc, I'd comment out or delete that rule and replace it with something like this:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="wlan*", NAME="wlan0"
Note: This WILL cause you problems if you later find you need two wlan devices installed or otherwise need to distinguish between different wlan devices.
I just re-read your question. It seems like you might already have two wlan devices in the machine. I'm not sure if what you want is possible in that situation unless one of the devices is always the same (and has its own udev rule that comes before the generic rule) while the second device varies.
One possible method is to run something like sed -i -e '/wlan/d' /etc/udev/rules.d/70-persistent-net.rules
on every reboot or from a root shell (and remember to make udev
reload its config) before you swap the wlan usb adaptors. I know this works with eternet devices because I have to do something very similar whenever I replace a machine's motherboard or PCI-e ethernet card, or clone a system to new hardware.
Also Note: this works with a sysvinit
debian system. I have no idea if it works the same on a systemd
machine - the only systemd
machine I have doesn't have a wlan interface, only ethernet. and I really don't feel like messing with it's network config right now, it was hard enough getting systemd
to do what I wanted when I replaced its NIC (by replacing its motherboard) a few months ago.
add a comment |
You probably have to have an entry in /etc/udev/rules/70-persistent-net.rules
that allocates the same wlan0
name to any wlan device that it detects.
e.g. On one of my systems, I have a TP-Link TL-WN721N that has the following rule:
# USB device 0x:0x (ath9k_htc) TP-Link TL-WN721N
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
If I wanted to turn that into a generic rule that matched any WLAN device, regardless of the MAC address etc, I'd comment out or delete that rule and replace it with something like this:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="wlan*", NAME="wlan0"
Note: This WILL cause you problems if you later find you need two wlan devices installed or otherwise need to distinguish between different wlan devices.
I just re-read your question. It seems like you might already have two wlan devices in the machine. I'm not sure if what you want is possible in that situation unless one of the devices is always the same (and has its own udev rule that comes before the generic rule) while the second device varies.
One possible method is to run something like sed -i -e '/wlan/d' /etc/udev/rules.d/70-persistent-net.rules
on every reboot or from a root shell (and remember to make udev
reload its config) before you swap the wlan usb adaptors. I know this works with eternet devices because I have to do something very similar whenever I replace a machine's motherboard or PCI-e ethernet card, or clone a system to new hardware.
Also Note: this works with a sysvinit
debian system. I have no idea if it works the same on a systemd
machine - the only systemd
machine I have doesn't have a wlan interface, only ethernet. and I really don't feel like messing with it's network config right now, it was hard enough getting systemd
to do what I wanted when I replaced its NIC (by replacing its motherboard) a few months ago.
You probably have to have an entry in /etc/udev/rules/70-persistent-net.rules
that allocates the same wlan0
name to any wlan device that it detects.
e.g. On one of my systems, I have a TP-Link TL-WN721N that has the following rule:
# USB device 0x:0x (ath9k_htc) TP-Link TL-WN721N
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="xx:xx:xx:xx:xx:xx", ATTR{dev_id}=="0x0", ATTR{type}=="1", KERNEL=="wlan*", NAME="wlan0"
If I wanted to turn that into a generic rule that matched any WLAN device, regardless of the MAC address etc, I'd comment out or delete that rule and replace it with something like this:
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", KERNEL=="wlan*", NAME="wlan0"
Note: This WILL cause you problems if you later find you need two wlan devices installed or otherwise need to distinguish between different wlan devices.
I just re-read your question. It seems like you might already have two wlan devices in the machine. I'm not sure if what you want is possible in that situation unless one of the devices is always the same (and has its own udev rule that comes before the generic rule) while the second device varies.
One possible method is to run something like sed -i -e '/wlan/d' /etc/udev/rules.d/70-persistent-net.rules
on every reboot or from a root shell (and remember to make udev
reload its config) before you swap the wlan usb adaptors. I know this works with eternet devices because I have to do something very similar whenever I replace a machine's motherboard or PCI-e ethernet card, or clone a system to new hardware.
Also Note: this works with a sysvinit
debian system. I have no idea if it works the same on a systemd
machine - the only systemd
machine I have doesn't have a wlan interface, only ethernet. and I really don't feel like messing with it's network config right now, it was hard enough getting systemd
to do what I wanted when I replaced its NIC (by replacing its motherboard) a few months ago.
answered Apr 19 '16 at 12:10
cascas
38.7k453101
38.7k453101
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f277498%2fhow-to-use-same-interfaces-settings-for-all-wlan-devices%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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