SliTaz SliTaz Forum

You are not logged in.

#1 2014-02-06 11:41:30

jawor
Member
Registered: 2014-02-06
Posts: 2

switch between wired and wifi

hello,

i have question/problem:

i managed to successfully install and configure my wifi, but now i have new problem - my wired connection wouldn't work sad

is there any way to quickly switch between two interfaces? say, i would like to use wifi when i'm outside, but when i get home/work i would like to quickly switch to wired connection.

Now, wifi is working, but when i connect cable slitaz is still using wifi sad

PS. is there any way to change wifi interface name? (now it's named eth1, when i edit config file and change to wlan0, it goes back to eth1 after reboot)

thanks for your help

(sorry for my english smile)

Offline

#2 2014-02-06 13:01:31

Ceel
Administrator
Registered: 2011-04-02
Posts: 1,424

Re: switch between wired and wifi

Hi jawor,

With SliTaz, you cannot have both wifi and wired connection.

To come back to wired, open TazPanel > Network > wifi and modify manually the network.conf file; change

[c]WIFI="yes"[/c]

to

[c]WIFI="no"[/c]

Save and it should work.

Offline

#3 2014-02-06 13:13:54

jawor
Member
Registered: 2014-02-06
Posts: 2

Re: switch between wired and wifi

i've figured it out seconds before your answer smile

so there's no other way? (maybe some kind of automate or script)

Offline

#4 2014-02-06 15:21:08

lricher
Member
Registered: 2014-01-16
Posts: 26

Re: switch between wired and wifi

Yes you could accomplish this with very simple scripts.

I am not an expert on the subject, but a quick and dirty solution would be 2 scripts or 1 script with a case switch / if statement.

Simplest thing I can think of is

wifiup

#!/bin/sh

sed -i.bak 's/WIFI="no"/WIFI="yes"/g' /etc/network.conf

/etc/init.d/network.sh restart

wifidown

#!/bin/sh

sed -i.bak 's/WIFI="yes"/WIFI="no"/g' /etc/network.conf

/etc/init.d/network.sh restart

place these in /usr/bin and chmod +x on both.

now you can just type wifidown or wifiup and you are good to go.

You could boil these down to a single command with on/off as options, if you prefer. This should be enough to get you started on that.

Offline

#5 2014-02-12 07:02:32

yves04
Member
Registered: 2012-09-23
Posts: 135

Re: switch between wired and wifi

Another solution (which works for me with wpa_supplicant).

From /etc/network.conf I've created two files

/etc/wifi_off.conf (the same as network.conf with WIFI="off")

/etc_wifi_on.conf with

WIFI="yes"

WIFI_INTERFACE="wlan0"

WIFI_ESSID="dlink"

WIFI_MODE="managed"

WIFI_KEY="*********"

WIFI_KEY_TYPE="WPA"

WPA_DRIVER=""

WIFI_CHANNEL=""

WIFI_IWCONFIG_ARGS=""

%0

If you are using WPA, juste type

#wpa_passphrase your_essid your_passphrase

and copy the result of this command in /etc/wpa_supplicant.conf

Then created two files /usr/bin/wifi_on.sh and /usr/bin/wifi_off.sh :

#!/bin/sh

/etc/init.d/network.sh stop

cp /etc/wifi_on.conf /etc/network.conf

/etc/init.d/network.sh start

and

#!/bin/sh

/etc/init.d/network.sh stop

cp /etc/wifi_off.conf /etc/network.conf

/etc/init.d/network.sh start

After that #chmod a+x /usr/bin/wifi_on.sh ; the same for wifi_off.sh

Eventually just type $wifi_on.sh (or $wifi_off.sh)

Offline

Registered users online in this topic: 0, guests: 1
[Bot] ClaudeBot

Board footer

Powered by FluxBB
Modified by Visman

[ Generated in 0.018 seconds, 7 queries executed - Memory usage: 1.54 MiB (Peak: 1.77 MiB) ]