Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Debian as router/gateway/dhcp(?)


    I'm new here, and new with linux.

    I'm currently setting up debian as a router/gateway and dhcp.
    Since I'm not used to debian nor linux, I thought I'll ask for help on some random linux forum, and ended up here.

    I've tried for a total of more than 10 hours, yet I fail. (I know I am noob ^^)

    The debian computer got 2 network cards, one that should be connected to the internet, and one which should go to a switch, with maybe two computers.

    I've tried doing all this with the help of guides on internet, I failed though, so I'm humbly requesting help. Please anyone.

    And since I'm not not used to linux, I would like to have the help as detailed as possible, even the simpliest things such as where I find the files I should edit and so on.

    I will try to be as active as I can, in order to answer possibly questions

    Best regards.

  2. #2
    Just Joined! monday90's Avatar
    Join Date
    Oct 2006
    United Kingdom
    As it would happen I recently set one of these up.

    I have the following configuration, you will need to adjust it for yourself.
    eth0 = WAN (internet)
    eth1 = LAN (Local Network)

    If you haven't done so already you will need the dhcp3-server package

    apt-get install dhcp3-server
    You will also need to edit your /etc/network/interfaces file
    My configuration is as follows
    # loopback interface
    auto lo
    iface lo inet loopback

    #Interface eth0
    auto eth0
    allow-hotplug eth0
    iface eth0 inet static

    #Interface eth1
    auto eth1
    allow-hotplug eth1
    iface eth1 inet static
    You will now need to edit your /etc/dhcp3/dhcpd.conf file

    you will need to adjust it for your own needs.

    subnet netmask {
    option domain-name-servers,;
    option routers;
    option subnet-mask;
    option broadcast-address;
    default-lease-time 86400;
    max-lease-time 676800;
    uncomment the following line in /etc/sysctl.conf
    ensure that the file /etc/default/dhcp3-server contains the following line, this is the interface that your DHCP server will run on.

    To do your IP masking for you (NAT server) install the ipmasq package
    apt-get install ipmasq
    now either reboot or restart the following services

    #/etc/init.d/networking restart
    #/etc/init.d/dhcp3-server restart
    You should now have a working DHCP server and NAT server. I'm sure that others on this forum will be able to improve on this configuration but this is what worked for me.

  3. #3
    Sorry for this late answer, but the help you supplied helped very much, and it works now. Thank you very much =)

  4. $spacer_open

Posting Permissions

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