LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-05-2008, 01:36 PM   #1
bcfriesen
LQ Newbie
 
Registered: Nov 2005
Distribution: Ubuntu 7.10
Posts: 16

Rep: Reputation: 0
Setting up a 2-NIC machine to be DHCP and router


I'm running Ubuntu 8.10 on a machine which I want to set up as a DHCP server and a router for a very small network (5-10 boxes). I consider myself quite competent with Linux, but I know very little about networking. I've searched for other DHCP server tutorials, but none of them address my specific setup.

My server has 2 NICs, one connected to the internet and the other connected to a switch which then connects to the clients. I've spent the past few days learning how to use dhcpd.conf, but I still can't get it to work correctly.

Here are specifics:

DNS server: 164.58.90.68 and 164.58.90.69
Gateway: 172.16.4.1
eth2 (connected to internet)
  • IP: 172.16.4.50
  • Broadcast: 172.16.4.255
  • Subnet mask: 255.255.255.0
eth0 (connected to switch and to client boxes)
  • IP: 192.168.1.0
  • Broadcast: 192.168.1.255
  • Subnet mask: 255.255.255.0

In short, I want this machine to be not only a DHCP server for the clients, but also a router so that they can access the internet through it. I'm guessing I have to use "IP forwarding" so that eth2 can communicate with eth0, but I'm having trouble figuring out how to do that.

Thanks in advance!
 
Old 09-05-2008, 01:57 PM   #2
bgeddy
Senior Member
 
Registered: Sep 2006
Location: Liverpool - England
Distribution: slackware64 13.37 and -current, Dragonfly BSD
Posts: 1,810

Rep: Reputation: 232Reputation: 232Reputation: 232
I'd suggest DNSMASQ for your DHCP/DNS server side of things and google terms include IPTABLES, NAT and MASQUERADE for you router side.

There are web based scripts available to generate suitable iptables scripts to save starting from scratch such as easy firewall generator
 
Old 09-05-2008, 03:58 PM   #3
Mr. C.
Senior Member
 
Registered: Jun 2008
Posts: 2,529

Rep: Reputation: 63
If this machine is only being used for said purposes, consider instead using one of the packages designed to route, firewall, provide services such as DHCP, content filtering, etc. Such packages are smoothwall, moonwall, etc. and they are very easy to setup and configure (all via GUI). Their GUIs will seem familiar to your as they look just like commodity routers you purchase.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
can't DHCP, i think due to ioctl's busy(?). sis900 NIC, linksys router, 2.4 kernel FirebirdV0273 Linux - Networking 2 02-11-2006 03:43 PM
Binding named to only one NIC of a dual NIC machine - possible? Paul_Randle Linux - Networking 3 08-24-2005 08:44 AM
Linux router - setting up a DMZ or default machine to route to Rooboy Linux - Networking 12 02-18-2004 03:44 PM
Setting up NAT/DHCP/Router/Firewall on Red Hat wingphil Red Hat 1 01-29-2004 07:34 AM
static ip machine attached to dhcp router? will this work? herron Linux - Networking 7 04-16-2003 06:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 10:33 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration