Can't ping host from guest

AdamK

Dabbler
Joined
Feb 23, 2023
Messages
13
I've set up Ubuntu VM, and I guest can't ping host (and host can't ping guest). Guest network access work overall, I can ping other machines on that network (and they can ping my VM).
NIC is set up as VirtIO (also tried emulated Intel card)
How can I fix it?
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You could have found references to the need for a bridge by searching the forum on "host guest ping".

Here's the documentation on what you need to do:
 

AdamK

Dabbler
Joined
Feb 23, 2023
Messages
13
Thank you. It worked after following that description.

I feel this is not very intuitive and could be handled better in the UI (with at least some hints).
 

AdamK

Dabbler
Joined
Feb 23, 2023
Messages
13
I spoke to soon unfortunately.

Now, situation is a bit strange. All services on my nas seem to work (and are accessible on my network), guest vm has network access, but nas do not see the world (internet), so I cant update apps catalogs or install/update apps, ntp does not sync, etc.

I think it happened because linked guide asks for disabling DHCP on the 'real' interface without proposing anything else in matter of routing/dns setup etc. I'll need some guidence on how to fix that.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Have you specified a default gateway and nameserver(s) (DNS) under the Global Configuration on the Network page?
 

AdamK

Dabbler
Joined
Feb 23, 2023
Messages
13
Yes, I tried that, and DNS querying seems to be working (I have my local network DNS server), but routing outside does not:

adamk@truenas:~$ host google.com
google.com has address 216.58.215.110
google.com has IPv6 address 2a00:1450:401b:814::200e
google.com mail is handled by 10 smtp.google.com.
adamk@truenas:~$ ping google.com
ping: connect: Network is unreachable
adamk@truenas:~$
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
What comes out of netstat -pr
 

AdamK

Dabbler
Joined
Feb 23, 2023
Messages
13
$ netstat -pr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
172.16.0.0 0.0.0.0 255.255.0.0 U 0 0 0 kube-bridge
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
You're missing a default route... makes sense you can't get out.

It should look more like this:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
default         192.168.0.1     0.0.0.0         UG        0 0          0 br01
172.16.0.0      0.0.0.0         255.255.0.0     U         0 0          0 kube-bridge
192.168.0.0     0.0.0.0         255.255.255.0   U         0 0          0 br01


Are you absolutely positive you defined the IPv4 Default Gatweay in the Network Global Configuration?
 

AdamK

Dabbler
Joined
Feb 23, 2023
Messages
13
Sorry, I forgot about the gateway :( (I fixated on DNS). Thanks, it works now :)
 
Top