Results 1 to 10 of 25

Thread: ISC-DHCP-SERVER configuration help!

Hybrid View

  1. #1
    Join Date
    Nov 2012
    Location
    Miami, FL
    Beans
    30
    Distro
    Ubuntu

    ISC-DHCP-SERVER configuration help!

    Hi everyone I am a noob to Linux but have created a squid proxy server already but it is not working when I connect other computers to the router, so I am using instead a ISC-DHCP-SERVER in order to give other pc's internet. I am running Ubuntu 12.10 and I am trying to set up a ISC-DHCP-SERVER through "eth0" being the internet nic and "eth0" the router to give other pc's internet. I have read many forums online on how to do this but for some reason cannot get it working. My ifconfig is

    PHP Code:
    eth0      Link encap:Ethernet  HWaddr 00:14:85:45:8f:62  
              inet addr
    :192.168.1.93  Bcast:192.168.1.255  Mask:255.255.255.0
              inet6 addr
    2602:304:499b:5ea9:29ff:f662:61c9:fe9f/64 Scope:Global
              
    inet6 addr2602:304:499b:5ea9:214:85ff:fe45:8f62/64 Scope:Global
              
    inet6 addrfe80::214:85ff:fe45:8f62/64 Scope:Link
              UP BROADCAST RUNNING MULTICAST  MTU
    :1500  Metric:1
              RX packets
    :11013 errors:0 dropped:0 overruns:0 frame:0
              TX packets
    :7707 errors:0 dropped:0 overruns:0 carrier:0
              collisions
    :0 txqueuelen:1000 
              RX bytes
    :10470262 (10.4 MB)  TX bytes:853099 (853.0 KB)

    eth1      Link encap:Ethernet  HWaddr 00:50:fc:55:27:7a  
              UP BROADCAST MULTICAST  MTU
    :1500  Metric:1
              RX packets
    :0 errors:0 dropped:0 overruns:0 frame:0
              TX packets
    :0 errors:0 dropped:0 overruns:0 carrier:0
              collisions
    :0 txqueuelen:1000 
              RX bytes
    :(0.0 B)  TX bytes:(0.0 B)

    eth1:avahi Link encap:Ethernet  HWaddr 00:50:fc:55:27:7a  
              inet addr
    :169.254.7.70  Bcast:169.254.255.255  Mask:255.255.0.0
              UP BROADCAST MULTICAST  MTU
    :1500  Metric:1

    lo        Link encap
    :Local Loopback  
              inet addr
    :127.0.0.1  Mask:255.0.0.0
              inet6 addr
    : ::1/128 Scope:Host
              UP LOOPBACK RUNNING  MTU
    :16436  Metric:1
              RX packets
    :13698 errors:0 dropped:0 overruns:0 frame:0
              TX packets
    :13698 errors:0 dropped:0 overruns:0 carrier:0
              collisions
    :0 txqueuelen:
              RX bytes
    :9921214 (9.9 MB)  TX bytes:9921214 (9.9 MB

    Can someone please advise what I should do next? When I...

    sudo service isc-dhcp-server stop

    I get a unknown instance:

    But when I start I get a start/running, process 5080

    Please help...thank you all.

  2. #2
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: ISC-DHCP-SERVER configuration help!

    First of all, I think you should split the "job".

    1. Are the clients receiving IPs or not? (probably not since the process doesn't seem to be running correctly). Check the IPs on the clients also with ifconfig (or ipconfig on windows).

    2. If this squid machine is supposed to be a router also, you need to configure both eth0 and eth1 interfaces, one external and the other internal. From your ifconfig eth1 doesn't seem to be configured with any IP, public or private.

    3. Also, for a machine to be a router it needs to have the ip_forward set to 1 in /etc/sysctil.conf. The line is commented by default so you need to remove the # at the start. The line is something like:
    /net/ipv4/ip_forward=1

    And you need at least one POSTROUTING rule in iptables so that it can act as a router. How you apply that rule will depend whether you are using a firewall on this machine or not. If not using a firewall, it's enough to edit /etc/rc.local and before the exit 0 add:
    iptables -t nat -A POSTROUTING -o ethX -j MASQUERADE

    where ethX is the external interface.
    Last edited by darkod; November 12th, 2012 at 05:37 PM.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  3. #3
    Join Date
    Nov 2012
    Location
    Miami, FL
    Beans
    30
    Distro
    Ubuntu

    Re: ISC-DHCP-SERVER configuration help!

    Hi Darko,

    Thanks for the reply.

    Well...

    1. The clients are not recieving IP addresses yet because I have not been able to get the DHCP running therefore I have not connect any other pc's to the eth0.

    2. Well the static eth0 I put in recently but when I had configured the proxy I had only the eth1 as a static and have toggled the eth1 with dhcp and static.

    3. I have done this as well making eth0 as the external interface. I did allow the ip_forward and the iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

    I am going to keep giving it a shot but this has seem to be a bit more challenging than expected.

  4. #4
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: ISC-DHCP-SERVER configuration help!

    What you did when you had only one interface is not very relevant. Since now you have two, I think it will work best if you dedicate one as external (towards your internet router, etc), and the other as internal (towards your LAN).

    So, set them up with static IPs in different subnets (ranges).

    What got me confused is in ifconfig in the eth1:avahi section you can see the IP like 169.254.x.x. Usualy that's an automatic IP when there is no other option available. Or you are using this IP on purpose?

    On the dhcp side, post /etc/dhcp/dhcp.conf the configuration file.

    Also, if I'm not mistaken, the daemon is still dhcpd so you can try:
    sudo service dhcpd start/stop/restart

    PS. Maybe this can help you:
    http://askubuntu.com/questions/14012...-a-dhcp-server
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

  5. #5
    Join Date
    Nov 2012
    Location
    Miami, FL
    Beans
    30
    Distro
    Ubuntu

    Re: ISC-DHCP-SERVER configuration help!

    I was actually confused with how the eth1:avahi came about. I do not recall setting that up or installing anything like that so I did not know how to approach it.

    I am trying to dedicate eth1 as the internet routerto give clients their IP's with eth0 as the internal that provides the internet. I should put both in the interface with different subnet ranges? Can eth0 be 192.168.1.93 which is the address?

    Thanks a bunch, again.

  6. #6
    Join Date
    Nov 2009
    Location
    Segur De Calafell, Spain
    Beans
    11,660
    Distro
    Ubuntu 12.04 Precise Pangolin

    Re: ISC-DHCP-SERVER configuration help!

    Yes, they can. So, you want eth0 to be 192.168.1.93 and 192.168.1.1 is the router that goes to the internet?

    For eth1 lets select 10.10.10.1 for example, with netmask 255.255.255.0 which covers the whole 10.10.10.x range.

    In that case /etc/network/interfaces would be like:
    Code:
    auto eth0
    iface eth0 inet static
       address 192.168.1.93
       netmask 255.255.255.0
       gateway 192.168.1.1
       dns-nameservers 8.8.8.8 8.8.4.4 (or you can use the ISP DNS servers instead)
    
    auto eth1
    iface eth1 inet static
       address 10.10.10.1
       netmask 255.255.255.0
    That's it.

    In the dhcp config you will have to tell it to use only eth1 to serve the dhcp clients. It's better not to send any dhcp traffic towards the internet router.

    This is just an example. In the /etc/network/interfaces code I didn't mention the lo interface, leave it as default as it is. Only make changes to eth0 and eth1.
    Darko.
    -----------------------------------------------------------------------
    Ubuntu 12.04 LTS 64bit & Windows 7 Ultimate 64bit

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •