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 01-26-2004, 11:56 AM   #1
phobox
Member
 
Registered: Dec 2003
Location: Columbus, OH USA
Distribution: Debian Knoppix Kanotix Sidux
Posts: 73

Rep: Reputation: 15
dns resolution on client machines


I am confused with my network settings. The problem I am having is that my linux box is setup as a gateway to my cable modem and although everything works alright on the linux box itself, any machines connected as clients don't get dns. That is, they can ping ip's but not names such as yahoo.com.

running ipconfig -all on a client yields:

(I am copying this by hand)
....
Dhcp enabled . .. : yes
autoconfiguration enabled: . . . : yes
IP address. . . .: 192.168.0.99
Subnet mask . .. .. : 255.255.255.0
Default gateway: . . . : 192.168.0.1
DHCP server . . . . : 192.168.0.1
DNS servers . . .. : 216.69.192.11
216.69.192.12
....

ifconfig -a on gateway:
eth0 Link encap:Ethernet HWaddr 00:50:8D:4B:6D:C8
inet addr:69.133.77.53 Bcast:255.255.255.255 Mask:255.255.254.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:116075 errors:0 dropped:0 overruns:0 frame:0
TX packets:5167 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:9318394 (8.8 MiB) TX bytes:593489 (579.5 KiB)
Interrupt:19 Base address:0x2000

eth1 Link encap:Ethernet HWaddr 00:48:54:8A:79:04
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:136603 errors:0 dropped:0 overruns:0 frame:0
TX packets:116592 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:149855159 (142.9 MiB) TX bytes:12510047 (11.9 MiB)
Interrupt:22 Base address:0x4000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6511 errors:0 dropped:0 overruns:0 frame:0
TX packets:6511 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:546272 (533.4 KiB) TX bytes:546272 (533.4 KiB)

--------------------------------
iptables (yes I know they are basic, I want to get it working first):

#!/bin/bash
#

# First clear out all the rules and close everything off but let outbound packets through
iptables -P INPUT ACCEPT
iptables -F INPUT
iptables -P OUTPUT ACCEPT
iptables -F OUTPUT
iptables -P FORWARD ACCEPT
iptables -F FORWARD
iptables -F -t nat

# turn on forwarding in the kernel
echo 1 > /proc/sys/net/ipv4/ip_forward

# Open up the internal network
iptables -A INPUT -i lo -s 127.0.0.0/8 -j ACCEPT
iptables -A INPUT -i eth1 -j ACCEPT

# Allow SSH from outside
iptables -A INPUT -i eth0 -p tcp --dport 22 -j ACCEPT
iptables -A INPUT -i eth0 -m state --state ESTABLISHED,RELATED -j ACCEPT

# IP Masquerading
#iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT
#iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
#iptables -A FORWARD -i eth1 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.0.0/24 -o eth0 -j SNAT --to-source 69.133.77.53

# Port Forwarding
#iptables -A FORWARD -p tcp -i eth0 -j ACCEPT

-------------------------------
route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
69.133.76.0 * 255.255.254.0 U 0 0 0 eth0
default cpe-069-133-076 0.0.0.0 UG 0 0 0 eth0
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth1

-------------------------------
dhcpd.conf
subnet 192.168.0.0 netmask 255.255.255.0 {
range 192.168.0.50 192.168.0.150;
option domain-name-servers 216.69.192.11, 216.69.192.12;
option domain-name "bobdole.gov";
option routers 192.168.0.1;
option broadcast-address 192.168.0.255;
default-lease-time 600;
max-lease-time 7200;
}


So can anyone help me?

Last edited by phobox; 01-26-2004 at 11:58 AM.
 
Old 01-26-2004, 01:37 PM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 48
You have 2 default routes listed, your external ip and an internal ip...
Delete the internal one;
route del default gw 192.168.0.1

And you only need one Masq/Snat rule, chose 1 and delete the other...

inet addr:69.133.77.53 Bcast:255.255.255.255 Mask:255.255.254.0
Check the netmask setting here.. it's awfully wide...
The broadcast isn't correct either..

From the workstations, in a command prompt, do
nslookup www.something.com
and see if it resolves...

If not, from win machines do
nslookup www.something.com 216.69.192.11 &
nslookup www.something.com 216.69.192.12
to test both servers.
From here I get REJECTs, prob restricted to your ip range.

There's nothing "wrong" with the rule list, but do
iptables-save
to print it on the screen and check what is actually running..

If it's still no-go,
add some logging rules to follow the packets through the tables..
eg iptables -t nat -I PREROUTING -i eth1 -p udp --dport 53 -j LOG --log-prefix "1 "
iptables -t nat -I POSTROUTING -o eth0 -p udp --dport 53 -j LOG --log-prefix "2 "
iptables -t nat -I PREROUTING -i eth0 -p udp --sport 53 -j LOG --log-prefix "3 "
iptables -t nat -I POSTROUTING -o eth1 -p udp --sport 53 -j LOG --log-prefix "4 "

Last edited by peter_robb; 01-26-2004 at 01:40 PM.
 
Old 01-30-2004, 06:48 PM   #3
phobox
Member
 
Registered: Dec 2003
Location: Columbus, OH USA
Distribution: Debian Knoppix Kanotix Sidux
Posts: 73

Original Poster
Rep: Reputation: 15
Thanks, it's working now.
 
  


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 see redhat machines from dns kagatone Linux - Newbie 7 09-15-2005 04:46 PM
NIS: yppasswd not working on client machines ice_hockey Linux - Networking 1 06-07-2005 12:21 AM
my DNS server doesn't remove don't existing machines cccc Linux - Networking 0 01-01-2005 03:30 PM
nslookup not working on client machines only nbarraud *BSD 3 11-25-2004 01:09 PM
How can I see my Linux server from Windows client machines? easwaran Linux - Networking 5 10-13-2004 04:03 PM

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

All times are GMT -5. The time now is 07:37 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
Open Source Consulting | Domain Registration