Discussion:
Trouble with networking on Google Compute Engine (NetBSD 7)
(too old to reply)
Benny Siegert
2016-12-29 12:22:51 UTC
Permalink
Hi!

I am still trying to get NetBSD 7 running on Google Compute Engine natively. The only remaining issue (AFAICT) is networking.

Here is how the GCE networking works: Each VM in a given project gets a private IP address, for example 10.240.0.4, with a netmask of 255.255.255.255. The DHCP response contains a „classless static route“ extension (121) to set a direct route to 10.240.0.1/32 on the same interface. In addition, there is a default route with 10.240.0.1 as gateway.

With -current and dhcpcd (not dhclient), this works fine.

With NetBSD 7 and the dhcpcd there (which AIUI is an older version), I get several error messages (that I forgot to write down) and no working network. wiz@ recommended dhcpcd-6.11.3 from pkgsrc, and that only emits a single error message: „add to routing socket: network is unreachable“ when adding the default route.

I tried adding the routes manually but that gets me the same error message:

route flush
route add -host 10.240.0.1 -interface vioif0
route add default 10.240.0.1

The last command fails with the „network is unreachable“ message.

I suspect that at this point, I may be running into a kernel bug / limitation that has been fixed in -current. Any ideas?

—Benny.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Roy Marples
2016-12-29 13:59:48 UTC
Permalink
Hi Benny
Post by Benny Siegert
Hi!
I am still trying to get NetBSD 7 running on Google Compute Engine natively. The only remaining issue (AFAICT) is networking.
Here is how the GCE networking works: Each VM in a given project gets a private IP address, for example 10.240.0.4, with a netmask of 255.255.255.255. The DHCP response contains a „classless static route“ extension (121) to set a direct route to 10.240.0.1/32 on the same interface. In addition, there is a default route with 10.240.0.1 as gateway.
With -current and dhcpcd (not dhclient), this works fine.
route flush
route add -host 10.240.0.1 -interface vioif0
route add default 10.240.0.1
The last command fails with the „network is unreachable“ message.
I suspect that at this point, I may be running into a kernel bug / limitation that has been fixed in -current. Any ideas?
—Benny.
Try this:
route flush
route add -net 10.240.0.1/32 -interface vioif0
route add default 10.240.0.1

dhcpcd-6.8 does that so it should work in the pkgsrc version as well.

Roy

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Benny Siegert
2016-12-31 11:55:53 UTC
Permalink
Post by Benny Siegert
route flush
route add -net 10.240.0.1/32 -interface vioif0
route add default 10.240.0.1
Found the explanation in https://www.netbsd.org/docs/network/#nonsubnetgateway, and it turns out things work when adding -ifa 10.240.0.3 (or -ifp vioif0) to the third command.

Is there any way to make dhcpcd do that (i.e. specify the interface when adding the default route)?
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Roy Marples
2016-12-31 17:09:32 UTC
Permalink
Post by Benny Siegert
Post by Benny Siegert
route flush
route add -net 10.240.0.1/32 -interface vioif0
route add default 10.240.0.1
Found the explanation in https://www.netbsd.org/docs/network/#nonsubnetgateway, and it turns out things work when adding -ifa 10.240.0.3 (or -ifp vioif0) to the third command.
Is there any way to make dhcpcd do that (i.e. specify the interface when adding the default route)?
dhcpcd has always done that (at least, on BSD since the support for it
predates BSD support).

Can you download a snapshot of the dhcpcd-6 branch from my repo and try
it please?
Login here as anonymous
https://roy.marples.name/projects/dhcpcd/login

Then download the branch tarball here:
https://roy.marples.name/projects/dhcpcd/tarball/dhcpcd-94ab98dabb.tar.gz?uuid=94ab98dabb05ab9124c27eee918fe4de8587ae3e

Roy

--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Benny Siegert
2017-01-01 11:36:05 UTC
Permalink
Post by Roy Marples
Can you download a snapshot of the dhcpcd-6 branch from my repo and try
it please?
I installed that into /usr/local and put the following into /etc/ifconfig.vioif0:

!/usr/local/sbin/dhcpcd vioif0

The output during boot was:

Configuring network interfaces: vioif0if_route (ADD): Network is unreachable

And I have no default route:

Routing tables
Internet:
Destination Gateway Flags Refs Use Mtu Interface
10.240.0.1/32 link#1 UC - - 1460L vioif0
10.240.0.4 127.0.0.1 UGHS - - 1460L lo0
127/8 127.0.0.1 UGRS - - 33648L lo0
127.0.0.1 127.0.0.1 UH - - 33648L lo0

The following works:

# route add default 10.0.240.1 -ifp vioif0
add net default: gateway 10.0.240.1
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Benny Siegert
2016-12-31 11:44:42 UTC
Permalink
Post by Benny Siegert
route flush
route add -net 10.240.0.1/32 -interface vioif0
route add default 10.240.0.1
This is what I get (and I have no idea why):

instance-3# route flush
10/0 localhost done
127/0 localhost done
::/128 localhost done
::/128 localhost done
::127.0.0.0/128 localhost done
::224.0.0.0/128 localhost done
::255.0.0.0/128 localhost done
::ffff:0.0.0.0/128 localhost done
2001:db8::/128 localhost done
2002::/128 localhost done
2002:7f00::/128 localhost done
2002:e000::/128 localhost done
2002:ff00::/128 localhost done
fe80::/128 localhost done
fe80:1::18a3:d7bf:ac 42:01:0a:f0:00:04 done
fe80:2::1/128 link#2 done
instance-3# route add -net 10.240.0.1/32 -interface vioif0
route: vioif0: bad value
instance-3# netstat -rnf inet
Routing tables
Internet:
Destination Gateway Flags Refs Use Mtu Interface
10.240.0.1/32 link#1 UC - - 1460 vioif0
127.0.0.1 127.0.0.1 UH - - 33648 lo0
instance-3# route add default 10.240.0.1
route: writing to routing socket: Network is unreachable
add net default: gateway 10.240.0.1: Network is unreachable

I just checked, and these commands do not work on -current either :(

—Benny.
--
Posted automagically by a mail2news gateway at muc.de e.V.
Please direct questions, flames, donations, etc. to news-***@muc.de
Loading...