route command - no default gateway

1 post / 0 new
#1 Wed, 2015-08-12 06:00
mgoodness
  • mgoodness's picture
  • Offline
  • Last seen: 2 years 7 months ago
  • Joined: 2015-08-12

I'm attempting to create an OpenVPN client within a Docker container based on Alpine. I've mostly succeeded, except that OpenVPN is unable to change the default gateway upon connection. The specific message is:

NOTE: unable to redirect default gateway -- Cannot read current default gateway from system

In trying to troubleshoot, I discovered that the 'route' command doesn't return a default gateway:

/openvpn # route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.17.0.0      *               255.255.0.0     U     0      0        0 eth0

Though 'ip route' does:

/openvpn # ip r
default via 172.17.42.1 dev eth0
172.17.0.0/16 dev eth0  proto kernel  scope link  src 172.17.0.39

Compare/contrast with the output from the same commands run on a Debian image:

root@51e708159cd8:/# route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         172.17.42.1     0.0.0.0         UG    0      0        0 eth0
172.17.0.0      *               255.255.0.0     U     0      0        0 eth0
 
root@51e708159cd8:/# ip r
default via 172.17.42.1 dev eth0
172.17.0.0/16 dev eth0  proto kernel  scope link  src 172.17.0.37

And for good measure, here are 'cat /proc/net/route' from both:

/openvpn # cat /proc/net/route
Iface   Destination     Gateway         Flags   RefCnt  Use     Metric  Mask            MTU     Window  IRTT
eth0    00000000        012A11AC        0003    0       0       0       00000000        0       0       0                                                                           
eth0    000011AC        00000000        0001    0       0       0       0000FFFF        0       0       0 
 
root@51e708159cd8:/# cat /proc/net/route
Iface   Destination     Gateway         Flags   RefCnt  Use     Metric  Mask            MTU     Window  IRTT
eth0    00000000        012A11AC        0003    0       0       0       00000000        0       0       0                                                                           
eth0    000011AC        00000000        0001    0       0       0       0000FFFF        0       0       0

Have I discovered a bug in... something? I'd be happy to help dig deeper. Otherwise, any suggestions about what I might be doing wrong would be appreciated.