Automatically switched eth0 and wlan0
#1
Hello,
I am Conrad. I am from Poland, my English isn't perfect yet, so please be forgiving.
I've got Linux Debian 8.1 on Acer 5560
I've got a little issue.
Is it possible, to make eth0 automatically turn off when Wi-Fi is turned on.
And also when I disable wifi by keyboard button (fn+f3), eth0 will automatically turn on.

BTW
When I try to turn off/on wlan0
I got that
'wl0 link up' and some numbers
http://m.imgur.com/yRPbABn
-Is it ok?
I also add, I had installed wpasupplicant , maybe that numbers are related with wpasuplicant?
Reply
#2
Hello,

I think interface bonding may be for you. Try to search google for it.
Reply
#3
this should rather be asked on debian forums.
Reply
#4
Ok, I'll search bonding.
Reply
#5
What do you think about that picture I sent?
Reply
#6
Just for my own interest, why do you want that?
Reply
#7
I've got two networks LAN form local router, and WiFi from android tablet with SIM card.
Reply
#8
well maybe interface bonding might be the better way and I don't know how debian handles this, but for ubuntu, if you have configured your network via '/etc/jnetwork/interfaces' you can use commands like "ifdown" or "ifup" or enter some commands in the interfaces file like:

Quote:pre-up # command or script, which should run before a network connection
up # command of script which should run during the startup of a network connection
post-up # command or script which should run after the startup of a network connection
pre-down # command or script which should run before closing/disconnecting from a network connection
down # command or script which should run during the closing/disconnecting from a network connection
post-down # command or script which should run after closing/disconnecting from a network connection

(^translated from a german website...so all for your own risk Wink....source: https://wiki.ubuntuusers.de/interfaces )

it seems debian is able to handle this in a related way:

https://wiki.debian.org/NetworkConfiguration

So you have many ways to achieve that....

One might be hacking a little shell script together which runs in background and which permanently checks if eth0 is up and if wlan0 comes up, ifdown eth0 and if wlan0 gets down ifup eth0 again. Don't know in which way this might affect the performance of your HTPC.

Maybe it's possible to run a shell script from inside Kodi. So you can create your own little plugin.

Run the plugin = ifdown eth0 and ifup wlan0
Run another plugin = ifdown wlan0 and ifup eth0

note: this all will only work if you have configured your network via /etc/network/interfaces. If you have done it, via your debian GUI those commands won't have any effect.
Reply
#9
So I'll make a little script.
BTW I haven't got GUI.
Reply

Logout Mark Read Team Forum Stats Members Help
Automatically switched eth0 and wlan00