LinuxQuestions.org
Visit Jeremy's Blog.
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 03-22-2005, 09:43 PM   #1
plehman
LQ Newbie
 
Registered: Jul 2003
Location: Durham, NC
Distribution: Fedora Core 2
Posts: 23

Rep: Reputation: 15
Configuring DNS and DHCP


Hi all,

I'm trying to configure a Fedora Core 2 PC to act as my home network's router for various windows and linux pcs. This PC has 2 NICs installed, and my network should look as follows:

Cable Modem ---eth0---> Fedora Core 2 ---eth1---> other Home Network PCs

from the Fedora box, I can access the internet properly, and my eth0 is configured via DHCP from the cable modem. I want to pass DNS requests from eth1 to eth0 and ultimately be able to host a DNS server on this machine.

Anyay, I set out to configure dhcpd for eth1 so that it will generate IP addresses for the other Home Network PCs. to do that, I kinda followed an app note and some other posts to do the following:

1) edit /etc/sysconfig/dhcpd and changed the line DHCPDARGS="" to DHCPDARGS="eth1"

2) create /etc/dhcpd.conf as follows (I got from the app note):
ddns-update-style ad-hoc;
allow bootp;
allow booting;
option timer-servers 192.168.2.1;
option domain-name "misc.com";
option domain-name-servers 192.168.2.1;
option broadcast-address 192.168.2.1;
option subnet-mask 255.255.255.0;
option routers 192.168.2.1;
subnet 192.168.2.0 netmask 255.255.255.0
{
range 192.168.2.100 192.168.2.120;
}

The idea here being that I want my eth1 NIC to have an address of 192.168.2.1, and all IP addresses assigned by it to the Home Network PCs would be from 192.168.2.100 - 120.

3) I edited /etc/named.conf to include a new "zone" per the app note:
zone "misc.com"
{
type master;
file "var/named/misc.com.hosts";
}

4) created file /var/named/misc.com.hosts as follows (again from the app note):
$ttl 38400
misc.com. IN SOA firewall.misc.com.
firewall.misc.com.
(
1031361928; se = serial number
10800; ref = refresh
3600; ret = update retry
604800; ex = expiration
38400; min = minimum
)
misc.com. IN NS firewall.misc.com.
firewall.misc.com IN A 192.168.2.1

5) edited /etc/hosts to include the following (left default lines there):
127.0.0.1 firewall.misc.com firewall
192.168.2.1 firewall firewall.misc.com

6) I then started the dhcpd and named services.

I connected my laptop to eth1, and it obtains an IP address of 192.168.2.120, but I cannot connect to the internet. It cannot find the DNS server. The gateway is set to 192.168.2.1 and when I run nslookup <anything> it tells me it cannot find the DNS server 192.168.2.1.

I think the problem is a mistake I have made somewhere trying to get eth1 to pass DNS requests to eth0 and hence to the ISP's DNS servers. I really need some help determining where to go next.
 
Old 03-22-2005, 11:57 PM   #2
mcd
Member
 
Registered: Aug 2003
Location: Denver, CO
Distribution: CentOS, Debian
Posts: 825

Rep: Reputation: 33
i don't know a lot about this stuff, but a couple things:

1. are you running a firewall? i know named listens on port 53 by default, so is this open?
2. i believe you need to set up ip masquerading, so that packets relayed from eth1 to the outside world appear to originate from eth0.

i've never set up masquerading, but look around and there's a lot of info i believe. but i don't really know what i'm talking about, so take it with a grain of salt. another thought is you could monitor traffic with tcpdump while you try connecting to a website with your client machine, and see if any obvious errors jump out at you.

tcpdump -i eth1 -n

for instance...
 
Old 03-24-2005, 07:48 AM   #3
plehman
LQ Newbie
 
Registered: Jul 2003
Location: Durham, NC
Distribution: Fedora Core 2
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks

You were right. I didn't realize it was called ip masquerading or else my google searches would've been more effective. I did a little more searching and it turns out there was an article on fedoranews.org, http://fedoranews.org/ghenry/GATWAY, that helped configure iptables to do this, even though his setup was a little different.

Thanks so much for your help.
 
Old 03-24-2005, 06:21 PM   #4
mcd
Member
 
Registered: Aug 2003
Location: Denver, CO
Distribution: CentOS, Debian
Posts: 825

Rep: Reputation: 33
excellent!

btw, i tried that link out (for someone else with a similar question) and it doesn't work. i googled ip masquerading and found this one though, if you want/need more resources: http://www.ibiblio.org/pub/Linux/doc...ade-HOWTO.html

Last edited by mcd; 03-24-2005 at 06:25 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
configuring dhcp eddie700 Fedora 2 10-09-2005 12:49 PM
configuring dns server on dhcp client ydpk Linux - Networking 3 11-04-2004 11:23 PM
forward dns from dhcp to dhcp Fark Linux - Networking 3 03-31-2004 11:40 AM
configuring ip address without using dhcp sanjaymistry Linux - Networking 3 09-02-2003 04:06 AM
DHCP and DNS and configuring both... wlewis Linux - Networking 2 07-20-2002 03:03 PM

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

All times are GMT -5. The time now is 01:29 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration