Relase dhcp but I have configured static IP

Kernels & Hardware, configuring network, installing services

Relase dhcp but I have configured static IP

Postby coppolino97 » 2018-06-14 09:39

Hello guys,
I have an Odroid, with 2 wifi cards.
They are working properly but I have a little issues with one of this wifi card.

I have configured two static IP of two different networks

Code: Select all
auto lo
iface lo inet loopback


auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.39
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1


#Seconda scheda WIFI
auto wlan1
allow-hotplug wlan1
iface wlan1 inet static
address 192.168.43.139
netmask 255.255.255.0
broadcast 192.168.43.255
gateway 192.168.43.1

#iface wlan1 inet dhcp



auto eth0
allow-hotplug eth0
iface eth0 inet static
address 192.168.0.100
netmask 255.255.255.0



The problem is that if I digit ifconfig the wlan0 has not 192.168.1.39 but 192.168.1.148 (from DHCP server, there is not dhcp reservation on the server)
Code: Select all
wlan0     Link encap:Ethernet  HWaddr 74:da:da:5f:ff:d3
          inet addr:192.168.1.148  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::76da:daff:fe5f:ffd3/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2376 errors:0 dropped:3 overruns:0 frame:0
          TX packets:387 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:619037 (619.0 KB)  TX bytes:75343 (75.3 KB)

wlan1     Link encap:Ethernet  HWaddr 40:9b:cd:5a:f0:54
          inet addr:192.168.43.139  Bcast:192.168.43.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)


Can I force to disable DHCP?
I am using wpa_supplicant for the two wifi connection and it works properly... the problem is the IP on the wlan0
Someone can help me?
Thanks
coppolino97
 
Posts: 5
Joined: 2018-06-05 15:23

Re: Relase dhcp but I have configured static IP

Postby bw123 » 2018-06-14 11:30

I don't know why that would happen with that interfaces file. If you bring it down and then back up, what happens? Do you see the dhcp request? What debian ver are you using, and are there any other network gui tools installed?

I'm not sure you should assign two separate default gateways like that, interfaces file needs one only? There are some threads on the board here about it.
User avatar
bw123
 
Posts: 3078
Joined: 2011-05-09 06:02
Location: TN_USA

Re: Relase dhcp but I have configured static IP

Postby wizard10000 » 2018-06-14 13:05

If you want a static IP

Code: Select all
auto wlan0  <-- this line needs to go away.
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.39
netmask 255.255.255.0
broadcast 192.168.1.255
gateway 192.168.1.1
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1279
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!

Re: Relase dhcp but I have configured static IP

Postby coppolino97 » 2018-06-15 07:33

Thanks for your help!

I don't know why that would happen with that interfaces file. If you bring it down and then back up, what happens? Do you see the dhcp request? What debian ver are you using, and are there any other network gui tools installed?
I'm not sure you should assign two separate default gateways like that, interfaces file needs one only? There are some threads on the board here about it.

On this odroid there is a derived of Debian (Ubuntu Mate).

@wizard10000
Can you explain me what is the difference between this two command?

After some test I have typed "ip addr" and I have seen that on the Wlan0 there are two IP:
- DHCP ip address is the priority
- Static ip address is the secondary ip address (and I does not see with "ifconfig")

Thanks for support!
coppolino97
 
Posts: 5
Joined: 2018-06-05 15:23

Re: Relase dhcp but I have configured static IP

Postby None1975 » 2018-06-15 13:06

coppolino97 wrote:On this odroid there is a derived of Debian (Ubuntu Mate).

Hello. Or maybe it's easier to go to Ubuntu Mate forums and ask there because Ubuntu Mate is not pure Debian.
OS: Debian 9.4 / WM: Xmonad
Debian Wiki | DontBreakDebian, My config files in github
Linux User #607425
User avatar
None1975
 
Posts: 473
Joined: 2015-11-29 18:23
Location: Lithuania, Vilnius

Re: Relase dhcp but I have configured static IP

Postby wizard10000 » 2018-06-15 13:25

coppolino97 wrote:...@wizard10000
Can you explain me what is the difference between this two command?


Sure.

That "auto wlan0" tells the machine to use DHCP. If you're setting a static IP on the machine you don't want that :mrgreen:
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1279
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!

Re: Relase dhcp but I have configured static IP

Postby p.H » 2018-06-15 20:10

wizard10000 wrote:That "auto wlan0" tells the machine to use DHCP. If you're setting a static IP on the machine you don't want that

Wrong. "auto" tells to bring the interface up when the system boots.
p.H
 
Posts: 394
Joined: 2017-09-17 07:12

Re: Relase dhcp but I have configured static IP

Postby wizard10000 » 2018-06-15 21:48

p.H wrote:Wrong.


Yup. I stand corrected.
we see things not as they are, but as we are.
-- anais nin
User avatar
wizard10000
 
Posts: 1279
Joined: 2011-05-09 20:02
Location: everywhere i go, there i am!

Re: Relase dhcp but I have configured static IP

Postby Head_on_a_Stick » 2018-06-16 09:15

coppolino97 wrote:After some test I have typed "ip addr" and I have seen that on the Wlan0 there are two IP:
- DHCP ip address is the priority
- Static ip address is the secondary ip address (and I does not see with "ifconfig")

Rather than offer a vague (and confusing) summary, why not simply post the full output of `ip a` instead? That would be *much* more useful.

Can we also please see the output of
Code: Select all
systemctl list-unit-files --state=enabled --no-pager
"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher."
— Antoine de Saint Exupéry, Terre des Hommes (1939).
User avatar
Head_on_a_Stick
 
Posts: 7547
Joined: 2014-06-01 17:46
Location: /dev/chair

Re: Relase dhcp but I have configured static IP

Postby coppolino97 » 2018-06-18 14:25

Thanks for your help!

This is the output after the command
systemctl list-unit-files --state=enabled --no-pager


Code: Select all
UNIT FILE                                 STATE

cups.path                                 enabled
accounts-daelon.service                        enabled
anacron-resume.service                        enabled
anacron.service                              enabled
autovto.service                              enabled
avahi-daelon.service                        enabled
avahi-dnsconfd.service                        enabled
binflt-support.service                        enabled
bluetooth.service                           enabled
brltty.service                              enabled
cpsnager.service                           enabled
cgproxy.service                              enabled
cron.service                              enabled
cups-browsed.service                        enabled
cups.service                              enabled
dbus-org.bluez .service                        enabled
dbus-oro.freedesktop.Avahi.service               enabled
dons-org.freedesktop.Node-lemma.service            enabled
display-lanaQer.service                        enabled
ffserver.service                           enabled
getty@.service                              enabled
gpsd.service                              enabled
lightdm.service                              enabled
lm-sensors.service                            enabled
ModemManager.service                        enabled
node-Ianager.service                        enabled
network-wireless@.service                     enabled
networking.service                           enabled
NetworkManager-wait--online.service               enabled
ofono.service                              enabled
pppd-dns.service                           enabled
resolvconf.service                           enabled
rsyslog.service                              enabled
setserial.service                           enabled
smartd.service                               enabled
smartmontools.service                        enabled
snapd.autoimport.service                            enabled   
snapd.service                                  enabled
snapd.system-shutdown.service                         enabled      
ssh.service                              enabled
sshd.service                              enabled   
syslog.service                              enabled   
systemd-timesyncd.service                     enabled
tlp-sleep.service                           enabled
tlp.service                                 enabled
ufw.service                              enabled
unattended-upgrades.service                     enabled
ureadahead.service                           enabled
whoopsie.service                           enabled
x11vnc.service                              enabled
zraI-config.service                           enabled
apport-foruard.socket                        enabled
avahi-daelon.socket                           enabled
cups.socket                              enabled
snapd.socket                              enabled
uuidd.socket                              enabled
reaote-fs.target                           enabled
apt-daily.timer                              enabled
snapd.refresh.timer                           enabled

58 unit files listed.


They are all enabled.
Thanks!
coppolino97
 
Posts: 5
Joined: 2018-06-05 15:23

Re: Relase dhcp but I have configured static IP

Postby Head_on_a_Stick » 2018-06-18 18:16

coppolino97 wrote:
Code: Select all
network-wireless@.service                     enabled

^ What is this and how did it get enabled?

I have a similarly-named custom unit file that I use to bring up my wireless connection and assign the IP addresses, does yours do that too?
Code: Select all
systemctl cat network-wireless@.service

^ This will show what is in the unit file.
Code: Select all
58 unit files listed.

Good grief, Ubuntu aren't shy about turning stuff on at boot, are they? :o
"Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher."
— Antoine de Saint Exupéry, Terre des Hommes (1939).
User avatar
Head_on_a_Stick
 
Posts: 7547
Joined: 2014-06-01 17:46
Location: /dev/chair


Return to System configuration

Who is online

Users browsing this forum: pappin and 6 guests

fashionable