Author Topic: Zentyal will not add default gateway from dhcp  (Read 16862 times)

michael-a

  • Zen Apprentice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Zentyal will not add default gateway from dhcp
« on: October 27, 2011, 08:13:20 pm »
Clean install of Ubuntu 11.10 (x86) running Zentyal 2.0.x (no PPA)
  • eth0 {DHCP, external} 192.168.1.104 -> current router (192.168.1.1) -> Cable Modem
  • eth1 {static, internal} 192.168.0.1 -> switch -> home network

From the Zentyal box's terminal, I can ping 192.168.1.1, but I cannot ping the IP's of any Internet sites. It's like there's no gateway configured. Ping says "destination network unreachable." In the Network -> Gateways section my dhcp-gw-eth0 is listed as enabled, default, and active. But nothing seems to use this gateway.

(I removed network-manager as it said it was no longer allowed to manage eth0 and eth1.)

EDIT: The routing tables are missing a gateway:

169.254.0.0 -> 0.0.0.0, netmask: 255.255.0.0, flags: U, metric: 1000, iface: eth1
192.168.0.0 -> 0.0.0.0, netmask: 255.255.255.0, flags: U, metric: 0, iface: eth1
192.168.1.0 -> 0.0.0.0, netmask: 255.255.255.0, flags: U, metric: 0, iface: eth0

I tried restarting the computer. I changing eth0 to "not set" in Network -> Interfaces. Then I saved, applied changes, and reconfigured it as DHCP/external. Sure enough, the gateway shows up in Network -> Gateways but does not get added to the routing table. Why?

Other threads mention this same issue without a cause or a fix...
« Last Edit: October 27, 2011, 11:10:51 pm by michael-a »

christian

  • Guest
Re: Zentyal will not add default gateway from dhcp
« Reply #1 on: October 27, 2011, 11:56:34 pm »
what's the behaviour if you try to "traceroute"?

michael-a

  • Zen Apprentice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Zentyal will not add default gateway from dhcp
« Reply #2 on: October 28, 2011, 12:22:50 am »
traceroute 208.67.222.222 says "network is unreachable"

The problem is Zentyal won't add the default gateway (from eth0's DHCP info) to the routing table. Since the routing table does not specify a route to the Internet, traceroute to an Internet IP will fail every time. If I add a known good route manually like so...

sudo route add default gw 192.168.1.1 eth0

...then the Zentyal box can access the Internet until I change a setting in ebox, which then erases the default gateway and of course Internet access is lost again.

However, it would be impractical to have to fix the routing table every time I change a setting in Zentyal. Also this is only a test case: I plan to remove the 192.168.1.1 router and replace it with the Zentyal box, which will then receive its IP/gateway/dns from cable modem via DHCP.

EDIT: I don't feel like doing a clean install of the Zentyal ISO tonight. The box has no optical drive and my USB creator program won't put the Zentyal ISO on my pendrive in a bootable way. There's some script errors about uninitialized strings (in a file called something like GatewayModel.rm) that I will try to report tomorrow. Is there any chance of getting an updated script or a fix submitted to Ubuntu 11.10 packages?
« Last Edit: October 28, 2011, 02:11:37 am by michael-a »

hyperguy

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Zentyal will not add default gateway from dhcp
« Reply #3 on: December 18, 2011, 12:40:26 pm »
I experience the same problem.

I have Zentyal computer connected to a modem on eth0 and the rest of my computers are connected through eth1.

When I do some changes in the webinterface of zentyal and save the parameters, I loose my internet connection on eth0.
I have to manually do a dhclieth eth0 to get things up and running.

If i go to Network->Gateway, I have a gateway there.
name: dhcp-gw-eth0
interface:eth0
default:(check)


Is there a way I could debug this? Is there a cli command to run and a log to trace to see what goes wrong?


devastate

  • Zen Apprentice
  • *
  • Posts: 1
  • Karma: +0/-0
    • View Profile
Re: Zentyal will not add default gateway from dhcp
« Reply #4 on: April 13, 2012, 12:47:14 am »
Seems like I also have a similar problem.

I have all machines connected to a router which also acts as a gateway.

When enabling dhcp on eth0, this machine is running zentyal, I can only see the internal network.
After manual adding a route specifying the router as default gateway external connections are up again.

My solution was to make eth0 static. But this is a workaround.
Other possibility is that I am doing something completely wrong  ;D

christian

  • Guest
Re: Zentyal will not add default gateway from dhcp
« Reply #5 on: April 13, 2012, 08:12:15 am »
Clean install of Ubuntu 11.10 (x86) running Zentyal 2.0.x (no PPA)
  • eth0 {DHCP, external} 192.168.1.104 -> current router (192.168.1.1) -> Cable Modem
  • eth1 {static, internal} 192.168.0.1 -> switch -> home network

Except if you have multiple devices between your router and Zentyal, DHCP here is not mandatory and is, in any case, managed ar router level which is responsible for providing default gateway to devices asking for lease. Have a look at this first.  8)

my $0.02

carliedu

  • Zen Apprentice
  • *
  • Posts: 10
  • Karma: +0/-0
  • Zentyal's default gateway problem 7 years birthday
    • View Profile
Re: Zentyal will not add default gateway from dhcp
« Reply #6 on: August 15, 2018, 02:14:24 pm »
It's incredible.
This error occurs for more than 7 years for a lot of users, and nobody has discovered what's wrong and created a script with the solution.
I would expect, at least, a solution from the developers.

sangamc

  • Zen Monk
  • **
  • Posts: 55
  • Karma: +2/-0
    • View Profile
Re: Zentyal will not add default gateway from dhcp
« Reply #7 on: November 06, 2023, 10:03:31 pm »
Can confirm in 2023 this is still an issue. I inevitably configure Domain controller so the server ends up with static, but it is super annoying when preparing a server and I hve to keep walking over and manually entering a gateway

arakan94

  • Zen Apprentice
  • *
  • Posts: 15
  • Karma: +2/-0
    • View Profile
Re: Zentyal will not add default gateway from dhcp
« Reply #8 on: August 05, 2024, 10:14:36 am »
Having a same problem..

When I set up network interfaces in webadmin, the automatic gateway is there and network works but when I restart, it's simply gone and I need to reconfigure or manually add route..

Only "solution" I came up so far, is to add the ip route command to rc.local and hope IPS won't change my IP.. :/

Siroco

  • Zentyal Staff
  • Zen Apprentice
  • *****
  • Posts: 26
  • Karma: +0/-0
    • View Profile
Re: Zentyal will not add default gateway from dhcp
« Reply #9 on: August 07, 2024, 12:54:46 pm »
Hi,

What network settings have you configured from the web administration panel (network interfaces and gateways)?

Regards.