Author Topic: help setting up gateway and dhcp  (Read 3456 times)

schooladminguy

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
help setting up gateway and dhcp
« on: October 18, 2013, 09:04:18 pm »
hi, im struggling with setting up my zentyal server, i have managed to set up gateway and dhcp, the clients seem to get their address from dhcp, but there is a problem with the internet sharing. On my windows 7 machines, it says there is  a problem with dns.

my setup is

netgear adsl router connected to internet - default gateway of router is 192.168.0.1
server is connected to router on eth1- i have left this to DHCP. IP address is 192.168.0.9
server is connected to 8 port switch from eth0 - this is set to static 192.168.1.1
i have allowed the range 192.168.1.2 - 254 for DHCP

I have also set up the gateway 192.168.1.1 on eth0 and set this to default

my win7 client which is connected to switch, has IP 192.168.1.2 - but there is no internet connection.

please advise me where i have gone wrong and what would be the best option, if is should use any other ranges etc. or any other config. thank you very much


robb

  • Guest
Re: help setting up gateway and dhcp
« Reply #1 on: October 18, 2013, 09:48:42 pm »
You have:
Code: [Select]
internet - Netgear router - Zentyal Server                          - internal network
              192.168.0.1 - eth1 DCHP 192.168.0.9 eth0 192.168.1.1  - 192.168.1.2/192.168.1.254

What you need to do to get internet access for your clients is mark eth1 as external.
Personally I would set eth1 also with static IP address (this can be any IP address in the subnet of your router) and default gateway the IP address of your router (192.168.0.1)
Further, I would reduce the DHCP scope of your internal LAN and leave, for example, the first 20 IP addresses outside the scope. This in case you ever need a fixed IP address for a printer or a wireless accesspoint.

schooladminguy

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: help setting up gateway and dhcp
« Reply #2 on: October 18, 2013, 11:49:05 pm »
The eth1 has already been set to external. But I will change the default gateway to 192.168.0.1 instead of 192.168.1.1 as it is currently

BrettonWoods

  • Guest
Re: help setting up gateway and dhcp
« Reply #3 on: October 18, 2013, 11:55:31 pm »
Maybe I am reading this wrong.

I usually just go with DHCP for my router and let the router do its business.
That way all the zentyal external Ips and gateway should be automatic.

The zentyal gateway should be the address of your router as thats the route to the internet.

The zentyal dhcp will set your clients gateway as the zentyal lan ip because thats your clients way to the internet.

ps do a /etc/init.d/networking restart

just to make sure the new settings are refreshed or reboot
« Last Edit: October 18, 2013, 11:59:45 pm by BrettonWoods »

schooladminguy

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: help setting up gateway and dhcp
« Reply #4 on: October 19, 2013, 12:30:33 am »
Maybe I am reading this wrong.

I usually just go with DHCP for my router and let the router do its business.
That way all the zentyal external Ips and gateway should be automatic.

The zentyal gateway should be the address of your router as thats the route to the internet.

The zentyal dhcp will set your clients gateway as the zentyal lan ip because thats your clients way to the internet.

ps do a /etc/init.d/networking restart

just to make sure the new settings are refreshed or reboot

if i am understanding correctly, are you suggesting that i use my router as the dhcp, and leave dhcp disabled on zentyal.

BrettonWoods

  • Guest
Re: help setting up gateway and dhcp
« Reply #5 on: October 19, 2013, 01:14:48 am »
Nope not all, its all getting confusing :)

The router has dhcp which sets the external zentyal nic

I usually leave the nic on the router as a dhcp client and let the router do the work.

The zentyal server dhcp will set your clients.

You shouldn't really have any need to be adding or changing gateways if setup is this way as its automatic.
« Last Edit: October 19, 2013, 01:17:02 am by BrettonWoods »

schooladminguy

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: help setting up gateway and dhcp
« Reply #6 on: October 19, 2013, 01:28:04 am »
sorry for all confusion. the netgear router has dhcp enabled which has given the external zentyal nic a IP 192.168.0.9
i have then set the inernal zentyal nic to static 192.168.1.1. and enabled dhcp is that ok?

BrettonWoods

  • Guest
Re: help setting up gateway and dhcp
« Reply #7 on: October 19, 2013, 01:35:51 am »
Then create a scope like rob said usually with a gap at the start for any printers and stuff.

I have a habit of doing my internal lan on 192.168.3.0 and it is just habit.

Purely because some routers use 192.168.0.0 and 192.168.1.0

I create a scope with a range starting at 192.168.3.32 to 192.168.3.254

Thats my usual default network sometimes I split the range on two nics and have a switch on one and my wifi on the other.

I was just wondering why you where adding and changing gateways?

The router ip is probably either 192.168.0.1 or 192.168.0.254 depending on brand.

Your gateway for zentyal on your external nic should be automatic because its set to dchp as a client.

The gateway will be your router ip.

Your internal lan which you are going to set up is static and start it at 192.168.1.1 with a netmask of 255.255.255.0 which means you can have 254 ips on that subnet.
255 will be a broadcast ip for that subnet.

Because you are connecting zentyal to something supplying the internet then its probably best just to let that happen automatically. So external lan set it to dhcp.

The internal lan is something we are going to control so static and often people start at the first or last IP for the server either 192.168.1.1 or 192.168.1.254

Then you need to add a scope in the dhcp to tell the clients what ips they can have. So 192.168.1.32 to 192.168.1.128 or maybe 192.168.1.129 to 192.168.1.222

With the above two I have done a half range.

The gap at the start or end depending on preference is just for any static objects which usually equate to printers.

Static objects must not be in the scope of the dhcp.
« Last Edit: October 19, 2013, 02:18:01 am by BrettonWoods »

christian

  • Guest
Re: help setting up gateway and dhcp
« Reply #8 on: October 19, 2013, 07:11:37 am »
such set up is supposed to be totally straightforward:
once IP addresses are set with or without DHCP as explained by Robb and once external interface is set as external, this should work.
Sometimes, it doesn't but in such case, you have to be a bit more accurate when describing what doesn't work, providing at least error message.

What I would suggest is that once Zentyal server is installed, you check from Zentyal server itself that you have access to internet.
If Zentyal can't access internet, clients wont neither, whatever protocol under investigation.
Once Zentyal can access internet, decide whether you want clients to access internet directly or using some service like HTTP proxy. Although HTTP is the obvious protocol when discussing "internet access", I strongly advise system admins to think about internet access in term of protocol and therefore to report error, if any, in term of protocol too.

robb

  • Guest
Re: help setting up gateway and dhcp
« Reply #9 on: October 19, 2013, 05:15:11 pm »
As I said, you can leave external interface of Zentyal set as DHCP client, but I often have some services on Zentyal (like a website or webapp) that need to be accessible from the outside. Then a static IP is needed so you can do portforwarding for the services on Zentyal that need access from the outside.

schooladminguy

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: help setting up gateway and dhcp
« Reply #10 on: October 19, 2013, 07:59:47 pm »
thanks for all the suggestions. i got it to work, i just had to set the router gateway to default. I dont know why i created another one! internet is working on all clients and dhcp is working i set the range for 192.168.1.32 - 128


As I said, you can leave external interface of Zentyal set as DHCP client, but I often have some services on Zentyal (like a website or webapp) that need to be accessible from the outside. Then a static IP is needed so you can do portforwarding for the services on Zentyal that need access from the outside.

i think i will need to set to static, because i want to be able to access the admin page of the server from outside. should i forward port 443 to my external ip (192.168.0.9) or the internal (192.168.1.1)?

BrettonWoods

  • Guest
Re: help setting up gateway and dhcp
« Reply #11 on: October 19, 2013, 08:21:38 pm »
You don't have to set it to static.

But just have a look at the zentyal dns settings (dns in networking not dns module) and your gateway.

If you are going to set as static then you will need these addresses think of static as manual settings.

BT routers with external ip's work with dhcp.

Can't remember virgin.

Just because its dhcp doesn't mean you can not do port forwarding or even that the address will change.

Depends on your ISP and router.

schooladminguy

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: help setting up gateway and dhcp
« Reply #12 on: October 22, 2013, 04:08:21 pm »
could someone please tell me what my dns servers should be, the server has been working fine with internet working on the clients until yesterday when i changed a few settings. now interntet is working on the zentyal server but not on any clients

i have three dns server ips under the dns in network module.
127.0.0.1
192.168.0.1 (the default gateway of the router connected to internet)
192.168.1.1 (default gateway of zentyal server / server ip address)

under gateways there is only one record
dhcp-gw-eth1 - 192.168.0.1 (eth1 is external)

Under the DNS page i have one forwarder
192.168.0.1

then i have one domain name which is rgszen1.lan
the hostname for the server is rgszen1 and the ip address is 192.168.1.1

internet is not working on clients, although i can access the admin config page from the client pcs via the ip address (https://192.168.1.1:443) and the hostname (https://rgszen1:443)

the error message from win7 clients - dns server is not responding
also, dhcp is working absolutely fine. i have also turned off the firewall
« Last Edit: October 22, 2013, 04:10:43 pm by schooladminguy »

christian

  • Guest
Re: help setting up gateway and dhcp
« Reply #13 on: October 22, 2013, 04:16:38 pm »
Setting properly DNS requires to understand that Zentyal has 2 DNS sections:
- one as client (DNS managed in network section)
- one as server, mainly used to server to - mainly internal - clients zone managed by Zentyal and also to act as DNS for clients if configured as such (relaying DNS requests to internet

In addition, it really helps to understand that for service like proxy, use of DNS depends on proxy configuration:
- if HTTP proxy is configured as "transparent", then resolving names is handled by client (here the browser) that will rely on its own DNS settings (likely Zentyal as "internal DNS server")
- if proxy is configured as "explicit", client doesn't try to resolve any name, this is done at proxy level (here Zentyal) relying on its "DNS client" configuration.

If you define Zentyal itself as secondary and third DNS (102.168.x.x) after localhost (127.0.0.1) being the first one, this is pretty inefficient.
In network section, you should better define external DNS like openDNS or DNS managed by your provider.
Be sure to set more than one single DNS here, always in addition to 127.0.0.1 being the first one.

EDIT: by adding external DNS to "network/dns configuration, it permits to resolve external names in case you internal DNS doesn't reply.
Setting both 127.0.0.1 and 192.168.0.1 (if this IP is one of Zentyal's IP, e.g.) is useless because both are reaching same DNS, the first one internally, the second one using NIC.

« Last Edit: October 22, 2013, 04:22:47 pm by christian »

schooladminguy

  • Zen Apprentice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: help setting up gateway and dhcp
« Reply #14 on: October 22, 2013, 05:12:39 pm »
thanks for your reply, very helpful. i will now configure as following

under network/dns config i will have
127.0.0.1
208.67.222.222 (opendns)
208.67.220.220 (OpenDNS)

then under the dns server settings, i will enable transparent dns cahche (for this firewall should be enabled right?)
and add the forwarders

192.168.0.1 (my internet router)
208.67.222.222 (opendns)
208.67.220.220 (OpenDNS)