LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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-20-2005, 11:10 AM   #1
wsxyz
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Rep: Reputation: 0
Can't access DNS from PC using NAT/masq


I have a computer running linux (self compiled 2.6.9 on top of RedHat 9) that
is connected to the internet via DSL. I want to also be able to use the
internet connection from a PC running Windows XP. I have set up a
network between the two and, following the IP MASQUERADE howto,
entered the following commands:

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
echo 1 > /proc/sys/net/ipv4/ip_dynaddr

Now I can ping the IP addresses of computers on the internet from the Windows
PC. In particular, I can ping my ISP's namesevers without any problem by pinging
their IP addresses.

However, the Windows PC cannot get any DNS service at all. I can't ping any
name and when I try nslookup on the Windows PC I get the message:

*** Can't find server name for address a.b.c.d no response from server
*** Can't find server name for address e.f.g.h no response from server
*** Default servers are not available
Default Server: UnKnown
Address: a.b.c.d

The addresses a.b.c.d and e.f.g.h are exactly the same addresses as in my linux
computer's /etc/resolv.conf file and there is no problem with using DNS from the
linux computer.

In case it's interesting, here's the output from "iptables -t nat -L -nvx"

Chain PREROUTING (policy ACCEPT 1013 packets, 76759 bytes)
pkts bytes target prot opt in out source destination

Chain POSTROUTING (policy ACCEPT 306 packets, 18430 bytes)
pkts bytes target prot opt in out source destination
106 6403 MASQUERADE all -- * ppp0 0.0.0.0/0 0.0.0.0/0

Chain OUTPUT (policy ACCEPT 408 packets, 24593 bytes)
pkts bytes target prot opt in out source destination

Any ideas?
 
Old 01-20-2005, 12:20 PM   #2
wsxyz
LQ Newbie
 
Registered: Jan 2005
Posts: 2

Original Poster
Rep: Reputation: 0
Responding to myself...

The answer is firewall settings. Making my internal interface trusted by adding the following line in
/etc/sysconfig/iptables:

-A RH-Lokkit-0-50-INPUT -i eth0 -j ACCEPT

made it work.
 
  


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
unable to VPN out from behind NAT (MASQ) dpmlq Linux - Networking 1 06-10-2005 03:00 PM
difference (NAT/Masq) slano Linux - Networking 1 01-11-2004 04:48 PM
NAT/DHCP/IP Masq Nighmare zdavis Linux - Networking 22 04-01-2003 01:21 PM
Win95 slow inet access via Linux MASQ raypen Linux - Networking 0 11-28-2002 09:39 AM
firewall script run at boot -> no masq, rerun manually -> masq worx Griffon26 Linux - Networking 2 06-24-2002 03:17 AM

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

All times are GMT -5. The time now is 08:24 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