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 ...
- 03-31-2010 #1Just 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
- 04-04-2010 #2
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
You will also need to edit your /etc/network/interfaces fileapt-get install dhcp3-server
My configuration is as follows
You will now need to edit your /etc/dhcp3/dhcpd.conf file# 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 need to adjust it for your own needs.
uncomment the following line in /etc/sysctl.confsubnet 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;
}
ensure that the file /etc/default/dhcp3-server contains the following line, this is the interface that your DHCP server will run on.net.ipv4.ip_forward=1
To do your IP masking for you (NAT server) install the ipmasq packageINTERFACES="eth1"
now either reboot or restart the following servicesapt-get install 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.#/etc/init.d/networking restart
#/etc/init.d/dhcp3-server restart
#ipmasq
- 04-13-2010 #3Just 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 =)


Reply With Quote
