Static IP makes network unusable. Topic is solved

Having issues with your DietPi installation or found a bug? Post it here.
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: Static IP makes network unusable.

Post by Joulinar »

what about ping google.com ?
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 »

ping any ip address or nslookup domain name works,

ping any domain name doesn't

Code: Select all

root@DietPi:~# ping 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
64 bytes from 1.1.1.1: icmp_seq=1 ttl=60 time=15.3 ms
64 bytes from 1.1.1.1: icmp_seq=2 ttl=60 time=10.3 ms
^C
--- 1.1.1.1 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 10.329/12.827/15.326/2.501 ms
root@DietPi:~# ping 8.8.8.8
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
64 bytes from 8.8.8.8: icmp_seq=1 ttl=120 time=11.4 ms
64 bytes from 8.8.8.8: icmp_seq=2 ttl=120 time=13.8 ms
^C
--- 8.8.8.8 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 3ms
rtt min/avg/max/mdev = 11.433/12.627/13.822/1.199 ms
root@DietPi:~# ping 9.9.9.9
PING 9.9.9.9 (9.9.9.9) 56(84) bytes of data.
64 bytes from 9.9.9.9: icmp_seq=1 ttl=56 time=138 ms
^C
--- 9.9.9.9 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 138.369/138.369/138.369/0.000 ms
root@DietPi:~# ping google.com
ping: google.com: No address associated with hostname
root@DietPi:~# ping apple.com
ping: apple.com: No address associated with hostname
root@DietPi:~# ping amazon.com
ping: amazon.com: No address associated with hostname

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

Non-authoritative answer:
Name:   google.com
Address: 172.217.175.14
Name:   google.com
Address: 2404:6800:4004:80b::200e

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

Non-authoritative answer:
Name:   apple.com
Address: 17.253.144.10

Last edited by maya95 on Fri Apr 23, 2021 12:39 pm, edited 1 time in total.
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: Static IP makes network unusable.

Post by Joulinar »

can you do following and post the output

Code: Select all

dig @9.9.9.9 google.com
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 »

Code: Select all

; <<>> DiG 9.11.5-P4-5.1+deb10u3-Debian <<>> @9.9.9.9 google.com
; (1 server found)
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 43355
;; 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.             200     IN      A       172.217.26.46

;; Query time: 42 msec
;; SERVER: 9.9.9.9#53(9.9.9.9)
;; WHEN: Fri Apr 23 18:40:01 CST 2021
;; MSG SIZE  rcvd: 55
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: Static IP makes network unusable.

Post by Joulinar »

ok DNS resolution is working in general if we ask the DNS server directly. Something seems to block the DNS request locally if we don't ask the DNS server directly. Or the system doesn't sent the request out. Quite a strange issue. We could have a look with tcpdump. Pls can you install it from dietpi-software (id 15). Once done open a 2nd SSH session and run tcpdump -i any -c500 -nn port 53. On the first window try to ping a domain. Usually tcpdump should collect the DNS packages now.

As well, can you share cat /etc/nsswitch.conf

PS: tcpdump will stop after 500 lines collected or once cancelled.
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 »

Code: Select all

root@DietPi:~# ping google.com
ping: google.com: No address associated with hostname

Code: Select all

root@DietPi:~# tcpdump -i any -c500 -nn port 53
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
19:00:01.027715 IP 192.168.0.8.37884 > 9.9.9.9.53: 49309+ A? google.com. (28)
19:00:01.028097 IP 192.168.0.8.37884 > 9.9.9.9.53: 37046+ AAAA? google.com. (28)
19:00:06.031733 IP 192.168.0.8.37884 > 9.9.9.9.53: 49309+ A? google.com. (28)
19:00:06.032042 IP 192.168.0.8.37884 > 9.9.9.9.53: 37046+ AAAA? google.com. (28)

Code: Select all

root@DietPi:~# cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         files
group:          files
shadow:         files
gshadow:        files

hosts:          files dns mymachines
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: Static IP makes network unusable.

Post by Joulinar »

as you can see on tcpdump, your system is sending our the DNS request

Code: Select all

root@DietPi:~# tcpdump -i any -c500 -nn port 53
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on any, link-type LINUX_SLL (Linux cooked), capture size 262144 bytes
19:00:01.027715 IP 192.168.0.8.37884 > 9.9.9.9.53: 49309+ A? google.com. (28)
19:00:01.028097 IP 192.168.0.8.37884 > 9.9.9.9.53: 37046+ AAAA? google.com. (28)
19:00:06.031733 IP 192.168.0.8.37884 > 9.9.9.9.53: 49309+ A? google.com. (28)
19:00:06.032042 IP 192.168.0.8.37884 > 9.9.9.9.53: 37046+ AAAA? google.com. (28)
but did not get an answer back. Means the response is not transferred to your device. On the VM, do you use bridged or not for the interface?
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 »

bridged. but why DHCP IP works yet static IP doesn't?

Being in the IT so many years, never encounter anything like this.
User avatar
Joulinar
Posts: 4536
Joined: Sat Nov 16, 2019 12:49 am

Re: Static IP makes network unusable.

Post by Joulinar »

if you are running on DHCP, how do you set STATIC? Do you enter a complet new IP address or do you use the option to transfer DHCP IP to STATIC?
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 »

Isn't it right here? Anytime I want to install new software, I have to switch back to DHCP to get a DHCP IP to get the software installed.
If I switch back to STATIC IP address, the ping command the Dietpi-Software execute does not pass test and will not allow me to proceed to install any software.

Image
Last edited by maya95 on Fri Apr 23, 2021 1:30 pm, edited 3 times in total.
Post Reply