[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Debian on raspberrypi: failed to configure wlan0



On 19/12/19 at 08:39, Bonno Bloksma wrote:
> Hello Franco,
> 
> So just to be sure we understand you correctly, and anyone else who thinks this is the solution...
> 
> [....]
>> Thanks for your answer I've just solved thank reading this link [1] it was the gateway line once commented all work fine. Now the wlan0 configuration file is:
>>
>>
>>
>> ~# cat /etc/network/interfaces.d/wlan0
>> # allow-hotplug wlan0
>> iface wlan0 inet static
>>     address 192.168.0.9
>>     netmask 255.255.255.0
>>     network 192.168.0.0
>>     broadcast 192.168.0.255
>>     # gateway 192.168.0.1
>>     wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
>>
>> Debian on raspberrypi works great I've cups, bind9, isc-dhcp-server running fine, if you are unsure give it a try.
>>
>>
>> [1]
>> https://raspberrypi.stackexchange.com/questions/13895/solving-rtnetlink-answers-file-exists-when-running-ifup
> 
> The discussion behind this links talks about the fact that a system can have only one default gateway, there can be only one gateway statement in the interfaces file(s).
> As you show us the config for one file in the interfaces.d/ directory, can we assume you have another interface that is up and running for which there is a separate file in interfaces.d/ ?
> That file might then not even have a gateway statement if it used dhcp.
> 
> Bonno Bloksma
> 
Hello Bonno,

I apologize if I didn't post my entire network configuration in
/etc/network/interfaces.d/ there is also a file called eth0 besides wlan0:

~# cat /etc/network/interfaces.d/eth0
auto eth0

iface eth0 inet static
       address 192.168.0.7
       netmask 255.255.255.0
       network 192.168.0.0
       broadcast 192.168.0.255
       gateway 192.168.0.1

The ifup command parse the eth0 file when it attempt to bring up wlan0
as you can see if is set in verbose mode:

~# ifup -vvv wlan0
ifup: reading directory /etc/network/interfaces.d
ifup: parsing file /etc/network/interfaces.d/eth0
ifup: parsing file /etc/network/interfaces.d/wlan0

ifup: configuring interface wlan0=wlan0 (inet)
/usr/sbin/ip addr flush dev wlan0
/bin/run-parts --exit-on-error --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
wpa_supplicant: wpa-driver nl80211,wext (default)
wpa_supplicant: /sbin/wpa_supplicant -s -B -P
/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -c
/etc/wpa_supplicant/wpa_supplicant.conf
Starting /sbin/wpa_supplicant...
wpa_supplicant: creating sendsigs omission pidfile:
/run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
wpa_supplicant: ctrl_interface socket located at
/var/run/wpa_supplicant/wlan0
/sbin/ip addr add 192.168.0.9/255.255.255.0 broadcast 192.168.0.255
  dev wlan0 label wlan0
/sbin/ip link set dev wlan0   up

/bin/run-parts --exit-on-error --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/avahi-daemon
run-parts: executing /etc/network/if-up.d/bind9
run-parts: executing /etc/network/if-up.d/mountnfs
run-parts: executing /etc/network/if-up.d/wpasupplicant

When ifup parse eth0 file find the gateway statement and when parse
wlan0 it found again a gateway statement for the same address therefore
it fails to bring up the interface.
So the solution is to comment/remove the gateway statement in wlan0, for
this LAN configuration (I thought).

Best regards
-- 
Franco Martelli


Reply to: