Static IP makes network unusable. Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
maya95
Posts: 48
Joined: Tue Apr 20, 2021 12:20 pm

Re: Static IP makes network unusable.

Post by maya95 »

Therefore it has something to do with the modem/router, not dietpi.
How? What would have causes this? I also tried to set different static IP to be sure there is no conflict.
User avatar
trendy
Posts: 292
Joined: Tue Feb 25, 2020 2:54 pm

Re: Static IP makes network unusable.

Post by trendy »

Since it is not happening only on the device running the dietpi, but to the other one as well, I don't see how is this connected to dietpi.
Most likely something to do with port security and dhcp snooping on the router.
maya95
Posts: 48
Joined: Tue Apr 20, 2021 12:20 pm

Re: Static IP makes network unusable.

Post by maya95 »

Since it is not happening only on the device running the dietpi, but to the other one as well, I don't see how is this connected to dietpi.
It happens on the other PC is because I also run DietPi on that physical PC doing the same installation and test.

I put the VM behind VMware NAT adapter (so it's double NAT and only one VMware's DHCP server) and it exhibits the same behavior,

So there is no DHCP snooping behind that NAT network or any existing port security.

Image

Anyway, I'm giving up.
User avatar
Joulinar
Posts: 4504
Joined: Sat Nov 16, 2019 12:49 am

Re: Static IP makes network unusable.

Post by Joulinar »

for me this seems to be something local on your side as you are the only user having these issues. DietPi is doing nothing else to set values inside /etc/network/interfaces and /etc/resolv.conf. These are plain Debian functions.

Anyway to exclude issues on /etc/resolv.conf you could use the tool dig. For this you would need to install dnsutils package

Code: Select all

apt install dnsutils


Furthermore I did a test on VM running on my Synology NAS without issues.

DHCP

Code: Select all

root@DietPiVM1:~# cat /etc/network/interfaces
# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# Loopback
auto lo
iface lo inet loopback

# Ethernet
allow-hotplug eth0
iface eth0 inet dhcp
As you can see system is set to DHCP. A test to resolve google.com works fine using Cloudflare as upstream DNS server.

Code: Select all

root@DietPiVM1:~# dig @1.1.1.1 google.com

; <<>> DiG 9.11.5-P4-5.1+deb10u3-Debian <<>> @1.1.1.1 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 58429
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

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

;; ANSWER SECTION:
google.com.             251     IN      A       142.250.74.238

;; Query time: 36 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Wed Apr 21 15:16:17 CEST 2021
;; MSG SIZE  rcvd: 55

root@DietPiVM1:~#


STATIC

Code: Select all

root@DietPiVM1:~# cat /etc/network/interfaces
# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# Ethernet
allow-hotplug eth0
iface eth0 inet static
As you can see system is set to STATIC. A test to resolve google.com works fine using Cloudflare as upstream DNS server.

Code: Select all

root@DietPiVM1:~# dig @1.1.1.1 google.com

; <<>> DiG 9.11.5-P4-5.1+deb10u3-Debian <<>> @1.1.1.1 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 45283
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

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

;; ANSWER SECTION:
google.com.             206     IN      A       142.250.74.238

;; Query time: 32 msec
;; SERVER: 1.1.1.1#53(1.1.1.1)
;; WHEN: Wed Apr 21 15:17:11 CEST 2021
;; MSG SIZE  rcvd: 55

root@DietPiVM1:~#
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
maya95
Posts: 48
Joined: Tue Apr 20, 2021 12:20 pm

Re: Static IP makes network unusable.

Post by maya95 »

The funny thing is the screen show my VMs DHCP IP is 192.168.0.104 when I move the VM to bridged adapter, not behind VMware NAT adapter

Code: Select all

 DietPi v7.0.2 : 21:22 - Thu 04/22/21
 ─────────────────────────────────────────────────────
 - Device model : Virtual Machine (x86_64)
 - CPU temp : N/A
 - LAN IP : 192.168.0.104 (eth0)
 - MOTD : Spring in northern hemisphere: Do you know the tulip command?
          Run "ss -tulp" to see which process listens on which TCP/UDP port.
 ─────────────────────────────────────────────────────

 DietPi Team     : MichaIng (lead), Daniel Knight (founder), Joulinar (support)
 Image           : DietPi Core Team (pre-image: Debian mini.iso)
 Web             : https://dietpi.com | https://twitter.com/DietPi_
 Patreon Legends : Camry2731
 Donate          : https://dietpi.com/#donate
 DietPi Hosting  : Powered by https://myvirtualserver.com

 dietpi-launcher : All the DietPi programs in one place.
 dietpi-config   : Feature rich configuration tool for your device.
 dietpi-software : Select optimized software for installation.
 htop            : Resource monitor.
 cpu             : Shows CPU information and stats.
and if I execute cat /etc/network/interfaces command, this is what I got
no matter how many times I reboot

Code: Select all

root@DietPi:~# cat /etc/network/interfaces
# Location: /etc/network/interfaces
# Please modify network settings via: dietpi-config
# Or create your own drop-ins in: /etc/network/interfaces.d/

# Drop-in configs
source interfaces.d/*

# Ethernet
allow-hotplug eth0
iface eth0 inet dhcp
address 192.168.80.80
netmask 255.255.255.0
gateway 192.168.80.2
#dns-nameservers 9.9.9.9

# WiFi
#allow-hotplug wlan0
iface wlan0 inet dhcp
address 0.0.0.0
netmask 0.0.0.0
gateway 0.0.0.0
#dns-nameservers 0.0.0.0
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
User avatar
Joulinar
Posts: 4504
Joined: Sat Nov 16, 2019 12:49 am

Re: Static IP makes network unusable.

Post by Joulinar »

If you are running DHCP, IP settings in /etc/network/interfaces are not used as they will be provided by the DHCP server. The only important setting is the DHCP value. /etc/network/interfaces is more applicable on STATIC IP. Better to use ip a to show actual assigned IP
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
maya95
Posts: 48
Joined: Tue Apr 20, 2021 12:20 pm

Re: Static IP makes network unusable.

Post by maya95 »

why a # sign in front of dns-nameservers 9.9.9.9 ?

#dns-nameservers 9.9.9.9
User avatar
Joulinar
Posts: 4504
Joined: Sat Nov 16, 2019 12:49 am

Re: Static IP makes network unusable.

Post by Joulinar »

As I told on the post above. These settings are not used in case if DHCP as you will get these values from the DHCP server...
Pls let us know if a solution is working. This could help others if they hit by similar situation. Your DietPi Team
maya95
Posts: 48
Joined: Tue Apr 20, 2021 12:20 pm

Re: Static IP makes network unusable.

Post by maya95 »

what's the differences between /etc/resolv.conf and /etc/resolvconf/resolv.conf.d/* ?

I don't have the latter.
maya95
Posts: 48
Joined: Tue Apr 20, 2021 12:20 pm

Re: Static IP makes network unusable.

Post by maya95 »

So while using static IP:
nslookup dietpi.com works, but ping dietpi.com doesn't

Code: Select all

 ─────────────────────────────────────────────────────
 DietPi v7.0.2 : 18:09 - Fri 04/23/21
 ─────────────────────────────────────────────────────
 - Device model : Virtual Machine (x86_64)
 - CPU temp : N/A
 - LAN IP : 192.168.0.8 (eth0)

curl: (28) Resolving timed out after 3007 milliseconds
 ─────────────────────────────────────────────────────

 DietPi Team     : MichaIng (lead), Daniel Knight (founder), Joulinar (support)
 Image           : DietPi Core Team (pre-image: Debian mini.iso)
 Web             : https://dietpi.com | https://twitter.com/DietPi_
 Patreon Legends : Camry2731
 Donate          : https://dietpi.com/#donate
 DietPi Hosting  : Powered by https://myvirtualserver.com

 dietpi-launcher : All the DietPi programs in one place.
 dietpi-config   : Feature rich configuration tool for your device.
 dietpi-software : Select optimized software for installation.
 htop            : Resource monitor.
 cpu             : Shows CPU information and stats.

root@DietPi:~#
root@DietPi:~# nslookup dietpi.com
Server:         9.9.9.9
Address:        9.9.9.9#53

Non-authoritative answer:
Name:   dietpi.com
Address: 172.67.173.4
Name:   dietpi.com
Address: 104.21.96.47
Name:   dietpi.com
Address: 2606:4700:3035::ac43:ad04
Name:   dietpi.com
Address: 2606:4700:3034::6815:602f

root@DietPi:~# ping dietpi.com
ping: dietpi.com: No address associated with hostname
Post Reply