How to use same interfaces settings for all wlan devices
up vote
4
down vote
favorite
I am working with a pcengines apu2c4 board with debian 8.4 installed.I am quite new to Linux.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 |
up vote
4
down vote
favorite
I am working with a pcengines apu2c4 board with debian 8.4 installed.I am quite new to Linux.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 |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I am working with a pcengines apu2c4 board with debian 8.4 installed.I am quite new to Linux.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.I am quite new to Linux.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 Nov 24 at 20:03
Rui F Ribeiro
38.3k1475126
38.3k1475126
asked Apr 19 '16 at 10:27
Simon Dunning
5417
5417
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
3
down vote
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 |
up vote
2
down vote
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 |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
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 |
up vote
3
down vote
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 |
up vote
3
down vote
up vote
3
down vote
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 Ribeiro
38.3k1475126
38.3k1475126
add a comment |
add a comment |
up vote
2
down vote
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 |
up vote
2
down vote
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 |
up vote
2
down vote
up vote
2
down vote
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
cas
38.3k44898
38.3k44898
add a comment |
add a comment |
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