LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 01-01-2022, 06:29 AM   #1
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Rep: Reputation: Disabled
Switching from DHCP kills wifi


Happy New Year!
Debian 11 bullseye
Attempting to configure /etc/network/interfaces with static ip address.
Results in "No valid active connections found!"
Code:
me@debian:~$ 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).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto wlp2s0
iface wlp2s0 inet static
address 192.168.5.2
netmask 255.255.252.0
gateway 192.168.4.1
dns-nameservers 209.16.64.2 209.16.64.1
Code:
me@debian:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether f4:8e:38:94:e2:6a brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether b0:c0:90:ac:cc:f1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.5.2/22 brd 192.168.7.255 scope global dynamic noprefixroute wlp2s0
       valid_lft 13422sec preferred_lft 13422sec
    inet6 fde5:7198:cd28:1:6abe:9fa0:ffca:57a/64 scope global temporary dynamic 
       valid_lft 603725sec preferred_lft 84868sec
    inet6 fde5:7198:cd28:1:b2c0:90ff:feac:ccf1/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 2591769sec preferred_lft 604569sec
    inet6 fe80::b2c0:90ff:feac:ccf1/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
 
Old 01-01-2022, 08:05 AM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,138
Blog Entries: 6

Rep: Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827Reputation: 1827
You gave very little info.

Code:
address 192.168.5.2
netmask 255.255.252.0
Code:
nmap -sL 192.168.5.2/22
Nmap scan report for 192.168.4.0
...
Nmap scan report for 192.168.7.255
Nmap done: 1024 IP addresses (0 hosts up) scanned in 0.02 second
So that will reach the gateway.

Code:
dns-nameservers 209.16.64.2 209.16.64.1
Code:
dig @209.16.64.2 google.com

; <<>> DiG 9.16.23 <<>> @209.16.64.2 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: REFUSED, id: 6843
;; flags: qr rd; QUERY: 1, ANSWER: 0, AUTHORITY: 0, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
; COOKIE: b088e45f09aa69adeea4ee0561d05e96dc1c99a817beb8ef (good)
;; QUESTION SECTION:
;google.com.                    IN      A

;; Query time: 30 msec
;; SERVER: 209.16.64.2#53(209.16.64.2)
;; WHEN: Sat Jan 01 08:03:50 CST 2022
;; MSG SIZE  rcvd: 67

dig @8.8.8.8 google.com

; <<>> DiG 9.16.23 <<>> @8.8.8.8 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 21474
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 512
;; QUESTION SECTION:
;google.com.                    IN      A

;; ANSWER SECTION:
google.com.             300     IN      A       142.250.191.206

;; Query time: 26 msec
;; SERVER: 8.8.8.8#53(8.8.8.8)
;; WHEN: Sat Jan 01 08:03:11 CST 2022
;; MSG SIZE  rcvd: 55
Have you tried another DNS.

Can you ping by IP, and not URL?

Need more info.

Quote:
wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
link/ether b0:c0:90:ac:cc:f1 brd ff:ff:ff:ff:ff:ff
inet 192.168.5.2/22 brd 192.168.7.255 scope global dynamic noprefixroute wlp

Last edited by teckk; 01-01-2022 at 08:07 AM.
 
1 members found this post helpful.
Old 01-01-2022, 09:36 AM   #3
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
Thanks for your help!
I will be more than happy to provide more info (assuming I understand what is required).
I have wifi connectivity now, because I erased this
Code:
auto wlp2s0
iface wlp2s0 inet static
address 192.168.5.2
netmask 255.255.252.0
gateway 192.168.4.1
dns-nameservers 209.16.64.2 209.16.64.1
returning the interfaces file to its original form.
Code:
me@debian:~$ sudo nmap -sL 192.168.5.2
Starting Nmap 7.80 ( https://nmap.org ) at 2022-01-01 09:21 CST
Nmap scan report for 192.168.5.2
Nmap done: 1 IP address (0 hosts up) scanned in 0.01 seconds
Do you need the results of the dig command?
 
Old 01-01-2022, 10:01 AM   #4
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
Would you please provide the output of ' ip address show ' and ' ip route show '

I suspect a subnet issue with different netmasks between the router and your host.
 
1 members found this post helpful.
Old 01-01-2022, 10:05 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
By default debian uses network manager which basically connects to the router/access point then runs dhclient to acquire an IP address

Network manager does have the capability to configure a static IP address.

If you want to setup wireless manually you will need to disable network manager and also add the router's SSID and passphrase.

https://wiki.debian.org/WiFi/HowToUse
 
1 members found this post helpful.
Old 01-01-2022, 10:25 AM   #6
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
@computersavvy
Code:
me@debian:~$ ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: enp1s0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether f4:8e:38:94:e2:6a brd ff:ff:ff:ff:ff:ff
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP group default qlen 1000
    link/ether b0:c0:90:ac:cc:f1 brd ff:ff:ff:ff:ff:ff
    inet 192.168.5.3/22 brd 192.168.7.255 scope global dynamic noprefixroute wlp2s0
       valid_lft 13977sec preferred_lft 13977sec
    inet6 fde5:7198:cd28:1:170a:680b:8806:5346/64 scope global temporary dynamic 
       valid_lft 604376sec preferred_lft 85519sec
    inet6 fde5:7198:cd28:1:b2c0:90ff:feac:ccf1/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 2591997sec preferred_lft 604797sec
    inet6 fe80::b2c0:90ff:feac:ccf1/64 scope link noprefixroute 
       valid_lft forever preferred_lft forever
Code:
me@debian:~$ ip route show
default via 192.168.4.1 dev wlp2s0 proto dhcp metric 600 
192.168.4.0/22 dev wlp2s0 proto kernel scope link src 192.168.5.3 metric 600
 
Old 01-01-2022, 11:26 AM   #7
uteck
Senior Member
 
Registered: Oct 2003
Location: Elgin,IL,USA
Distribution: Ubuntu based stuff for the most part
Posts: 1,173

Rep: Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501Reputation: 501
Manually configuring network settings for wireless needs more configuration then wired. This link has a condensed write-up about it: https://linuxconfig.org/how-to-conne...bian-10-buster
 
1 members found this post helpful.
Old 01-01-2022, 01:20 PM   #8
computersavvy
Senior Member
 
Registered: Aug 2016
Posts: 3,345

Rep: Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484Reputation: 1484
The info provided from your host looks good. Was that when you had manually set the static address or dhcp?
What is the subnet mask on the router?
If the router netmask and the host netmask differ then it causes problems. If they are the same, then the network address should be 192.168.4.0/22 which gives you the usable subnet addresses 192.168.4.1 - 192.168.7.254 with broadcast at 192.168.7.255. That is indicated on the host info you posted, but needs to be verified to match on the router.
 
1 members found this post helpful.
Old 01-01-2022, 01:47 PM   #9
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
Quote:
The info provided from your host looks good. Was that when you had manually set the static address or dhcp?
The code from post #6 is from my machine in stock form, without my code from post #3. I have not successfully set or changed anything (yet!).

Quote:
What is the subnet mask on the router?
I don't know how to find this.
Code:
me@debian:~$ sudo route -n
[sudo] password for me: 
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.4.1     0.0.0.0         UG    600    0        0 wlp2s0
192.168.4.0     0.0.0.0         255.255.252.0   U     600    0        0 wlp2s0



Quote:
...then the network address should be 192.168.4.0/22
Would that be my machine's ip address or the gateway?

Last edited by bayou self; 01-01-2022 at 02:31 PM. Reason: added info
 
Old 01-01-2022, 05:02 PM   #10
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
I tried nm-connection-editor, and I'm cautiously optimistic, as it is working for now. I entered the same data for address, netmask, gateway, and nameservers as in post #3 above.
/etc/NetworkManager/system-connections has same. /etc/network/interfaces is unmodified.

Last edited by bayou self; 01-01-2022 at 05:05 PM. Reason: clarity
 
Old 01-01-2022, 05:08 PM   #11
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
The only caveat is the static IP address should not be in the range of addresses assigned by the DHCP server otherwise there could be a conflict.
 
1 members found this post helpful.
Old 01-01-2022, 05:31 PM   #12
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
@michaelk,
The IP address I chose was from one of the many found when running "ip a"...you are saying that's not good?

Q1: Is DHCP still active?
Q2: How do I find the range of addresses assigned by the DHCP server?
Q3: Can I assign the IP address any way I want, such as 192.168.anything.anything?
 
Old 01-01-2022, 05:38 PM   #13
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by bayou self View Post
@michaelk,
The IP address I chose was from one of the many found when running "ip a"...you are saying that's not good?

Q1: Is DHCP still active?
Q2: How do I find the range of addresses assigned by the DHCP server?
Q3: Can I assign the IP address any way I want, such as 192.168.anything.anything?
I'd ask why you're wanting/needing to do this. If this is a laptop, you're just going to make it more difficult for yourself to take it places and use it, since the address you set for your home, most likely won't work in another location. Having a 'set' address for your system does make some things easier, though....I'd suggest going into your router settings, and set your device to 'keep' the DHCP address. It should tie to the MAC address on the system, and every time it comes up at home it'll get the same address. But in another location, it'll work normally.
 
1 members found this post helpful.
Old 01-01-2022, 05:55 PM   #14
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,703

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
Quote:
The IP address I chose was from one of the many found when running "ip a"...you are saying that's not good?
The IP address found from the IP command was assigned by a DHCP server, either by your router, ISP or however you connect to the internet. If it isn't your own router then as soon as the DHCP lease expires that address goes back into the pool and could be assigned to other computers on the same network. If that happens there could be an address conflict which means that you and the other computer will not be able to access the network/internet.

Q1: The server is still active but your computer will not ask it for an address. Most DHCP servers now days will try to assign the same address to the same computer as long as the lease is still active.

Q2: If you do not own or have access to the router or device that runs DHCP server then it is not possible. If you do own the router then you can login to its web configuration page to check the range. If the latter is true then you might want to configure an address reservation versus static IP address which is essentially the same thing. This would be better if your PC is a laptop.

Q3: It depends. If the network/router is your own then basically yes but it must be within the same subnet as assigned by your router but again outside its DHCP server range. Otherwise no.

Last edited by michaelk; 01-01-2022 at 06:10 PM.
 
2 members found this post helpful.
Old 01-01-2022, 06:28 PM   #15
bayou self
Member
 
Registered: Sep 2018
Location: Louisiana
Distribution: Debian 11.1 (bullseye)
Posts: 81

Original Poster
Rep: Reputation: Disabled
@TB0ne
Quote:
I'd ask why you're wanting/needing to do this.
Linux From Scratch
Quote:
If this is a laptop, you're just going to make it more difficult for yourself
Stationary desktop

From Linux From Scratch Version 11.0, Chapter 9--General Network Configuration
Quote:
The following command creates a sample file for the eth0 device with a static IP address:

cd /etc/sysconfig/
cat > ifconfig.eth0 << "EOF"
ONBOOT=yes
IFACE=eth0
SERVICE=ipv4-static
IP=192.168.1.2
GATEWAY=192.168.1.1
PREFIX=24
BROADCAST=192.168.1.255
EOF

The values in italics must be changed in every file to match the proper setup.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP: Problem creating Private Network using 3G modem, fedora(DHCP) and wifi router sd|| Linux - Networking 1 07-23-2011 06:12 AM
switching focus to my SDL app in fvwm freezes display, kills dbus? ruhler Linux - Software 0 02-13-2011 11:47 AM
[SOLVED] USB camera kills wifi. portamenteff Linux - Hardware 3 11-15-2010 10:44 PM
[SOLVED] switching to vt kills internet connection page_seven Linux - Software 3 09-12-2010 12:22 AM
Belkin KVM "kills" the mouse when switching to Linux {usuario} Linux - Hardware 1 06-07-2005 01:15 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:16 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration