Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I can't tell what I'm doing wrong here.
I have searched this forum and google, but have not come up with an answer. The problem seems common with raspberry pi versions of debian.
When I boot, my laptop is assigned a dynamic address.
I have cleared the address allocation from the router, but it assigns new addresses on reboot.
Code:
$ cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
#auto eth0
#allow-hotplug eth0
#iface eth0 inet dhcp
auto wlan0
allow-hotplug wlan0
iface wlan0 inet static
address 192.168.1.98
netmask 255.255.255.0
network 192.168.1.0
broadcask 192.168.1.255
gateway 192.168.1.1
dns-nameservers 8.8.8.8
dns-nameservers 8.8.4.4
In order for the static address to take, I have to ifdown/ifup the wifi
Are you master in the wifi? Are you the AP? If not, you ask for an IP when logging in, don't you?
I'm not sure what you mean by master in the wifi, or AP, sorry.
All I can tell is that when I boot the laptop it acquires a dynamically assigned address, and then when I cycle the ifdown/ifup, I get the static address.
If it needs a static ip, wire it in with Cat5 or Cat6 network cable. You are not the AP by default. So you log in, and get assigned an ip. But you alter that with ifdown & ifup. I wonder about routing.
Do you add any stati routes.
If your goal is to have static IPs on boot, configure your connections accordingly: give those connections bootproto=static and reserve those addresses with the DHCP of the router. DHCP gives out IPs in a range, so at the web interface of your router reserve those IP addresses for your devices. Otherwise, IP addresses given by DHCP will override your static IP settings.
bootproto=static is only valid for Red Hat/CentOS/Fedora distributions.
I'm lazy, I keep my laptop configured as DHCP and then configure the router to always assign the same IP address. Most home router's DHCP server can assign the same address based upon the devices MAC. That way I do not have to change settings when I travel.
Is installed network-manager and running? If so that could be the reason wlan is using DHCP at boot but when you run ifup it is assigned a static IP address.
So I do have Network Manager running, but everything I have read says that the above configuration should override that. I configured the file as follows:
Still I get DHCP when I boot. I don't want to have to hard wire to the network; the point is I want a static wireless IP address. Do I need Network Manager? How do I disable it, and what are the consequences of that?
I'm lazy, I keep my laptop configured as DHCP and then configure the router to always assign the same IP address. Most home router's DHCP server can assign the same address based upon the devices MAC. That way I do not have to change settings when I travel.
I mean I can do this; I'm just obsessive and I want to know why it's not working as an assigned static address.
bootproto=static is only valid for Red Hat/CentOS/Fedora distributions.
I'm lazy, I keep my laptop configured as DHCP and then configure the router to always assign the same IP address. Most home router's DHCP server can assign the same address based upon the devices MAC. That way I do not have to change settings when I travel.
Is installed network-manager and running? If so that could be the reason wlan is using DHCP at boot but when you run ifup it is assigned a static IP address.
Given. I am not familiar with Debian's NIC config file syntax. Do you see anywhere in that file snippet the OP posted that a NIC is available at boot? The equivalent of ONBOOT=yes on Red Hat-ish systems?
Disabling Network Manager isn't an option since other parts (like firewalld) depend on it. So it would be better to just reserve those static IPs with the DHCP server and make NICs available on boot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.