On Tue, Feb 2, 2016 at 3:47 PM, Antti Kantee <[email protected]> wrote:
> No, not an IP route, but rather a link route. So you instruct the
> networking stack that the address of the gateway is reachable via vioif0, no
> matter what the IP routing table says. Now, I need to do that kind of stuff
> once every 5 years, so I don't remember exactly how to do it off the top of
> my head. A newer version of dhcpcd -- which give or take some missing limbs
> and mutations is where the dhcp code comes from -- might already contain the
> magic spell. Another way to figure it out is to play with the route command
> from rumpctrl and use -v to print the routing message you need to send to
> the networking stack.
I couldn't find anything called a link route, but I added a host route
and it seems to work.
I looked at the newest dhcpcd but the code seems to have changed
dramatically since 2009 and I also do not know if it works on GCE. I
also am not sure how to use rumpctrl on GCE.
Here's the patch I used to make it work on GCE:
diff --git a/brlib/libnetconfig/dhcp_configure.c
b/brlib/libnetconfig/dhcp_configure.c
index 7aa820c..8d55691 100644
--- a/brlib/libnetconfig/dhcp_configure.c
+++ b/brlib/libnetconfig/dhcp_configure.c
@@ -247,10 +247,21 @@ massage_host_routes(struct rt *rt, const struct
interface *iface)
{
struct rt *r;
- for (r = rt; r; r = r->next)
+
+ for (r = rt; r; r = r->next) {
if (r->gate.s_addr == iface->addr.s_addr &&
- r->net.s_addr == INADDR_BROADCAST)
+ r->net.s_addr == INADDR_BROADCAST){
+ r->gate.s_addr = r->dest.s_addr;
+ }
+
+ /*
+ Some DHCP servers (GCE) set a route with a netmask of 255.255.255.255
+ we need to set the gate on there so that this route actually works
+ https://code.google.com/p/google-compute-engine/issues/detail?id=77
+ */
+ if (r->gate.s_addr == INADDR_ANY && r->net.s_addr ==
INADDR_BROADCAST)
r->gate.s_addr = r->dest.s_addr;
+ }
return rt;
}
Is there any chance that this change could be included so that other
people might be able to use rumprun on GCE?