A
A
alex stephen2015-02-20 02:08:28
Debian
alex stephen, 2015-02-20 02:08:28

Debian, wlan if lan is disabled. How?

There is a home debian server connected to the router by wire. Its internal IP is always 192.168.1.101
The server has a wi-fi module. How to make it so that when the wire is disconnected, it connects itself over the air with the same IP?
Accordingly, when connecting the wire, you need to connect through it.
Here is the current config (wlan was not configured at all)

auto lo
iface lo inet loopback

# The primary network interface
#allow-hotplug eth0
auto eth0
iface eth0 inet static
 address 192.168.1.101
 netmask 255.255.255.0
 gateway 192.168.1.1

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Valentin, 2015-02-20
@berezuev

Write the required script and add it to pre-up, post-up, pre-down, post-down actions in /etc/network/interfaces . You can read more, for example, here .

J
jidckii, 2015-02-20
@jidckii

Well, the only thing that comes to mind is to run some script written by you using the cron, which, for example, will go through the cron every 5 minutes and see if there is a link on the eth0 interface. And in case of its absence, connect to the wifi with a specific SSID.
I think there will be no solutions out of the box in this case.
In general, a strange task))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question