Find the answer to your Linux question:
Results 1 to 3 of 3
Greetings. 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 ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2010
    Posts
    2

    Debian as router/gateway/dhcp(?)


    Greetings.

    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.
    Swedish_Buddha

  2. #2
    Just Joined! monday90's Avatar
    Join Date
    Oct 2006
    Location
    United Kingdom
    Posts
    82
    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
    address 10.10.7.11
    netmask 255.255.255.0
    network 10.10.7.0
    broadcast 10.10.7.255
    gateway 10.10.7.1
    dns-nameservers 208.67.222.222 208.67.220.220
    dns-search your.chosen.domain.name.here

    #Interface eth1
    auto eth1
    allow-hotplug eth1
    iface eth1 inet static
    address 192.168.7.1
    netmask 255.255.255.128
    network 192.168.7.0
    broadcast 192.168.7.127
    dns-nameservers 208.67.222.222 208.67.220.220
    dns-search your.chosen.domain.name.here
    You will now need to edit your /etc/dhcp3/dhcpd.conf file

    you will need to adjust it for your own needs.

    subnet 192.168.7.0 netmask 255.255.255.128 {
    range 192.168.7.2 192.168.7.126;
    option domain-name-servers 208.67.222.222, 208.67.220.220;
    option routers 192.168.7.1;
    option subnet-mask 255.255.255.128;
    option broadcast-address 192.168.7.127;
    default-lease-time 86400;
    max-lease-time 676800;
    }
    uncomment the following line in /etc/sysctl.conf
    net.ipv4.ip_forward=1
    ensure that the file /etc/default/dhcp3-server contains the following line, this is the interface that your DHCP server will run on.

    INTERFACES="eth1"
    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
    #ipmasq
    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
    Just Joined!
    Join Date
    Mar 2010
    Posts
    2
    Sorry for this late answer, but the help you supplied helped very much, and it works now. Thank you very much =)

Posting Permissions

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