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 06-30-2004, 10:04 PM   #1
jobano
LQ Newbie
 
Registered: May 2004
Location: France
Distribution: fresh Ubuntu
Posts: 21

Rep: Reputation: 15
dns unavailable through nat


hello,

I've got an adsl usb-modem web access and I want to share it on my lan...

I've used some iptables rules (copy pasted from the web) to create a 'standard' nat and it looks nice ! any web IP is reacheable from my lan but not the names...

I firstly thought port 53 dns requests will be forward like everything here... but apparently not
Then I tried to use a 'cache' dns server on my nat server but even that, (and even the fact that on debian package, bind is a cache dns server by default) nothing...

I feel like a lost cowboy at the end of my command line, please help.
 
Old 06-30-2004, 11:00 PM   #2
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
how does your resolv.conf look?
do you get your ip address from a dhcp server?

and your NAT line looks

iptables -t nat -A POSTROUTING <etc etc> -j MASQUERADE
 
Old 07-01-2004, 02:35 AM   #3
jobano
LQ Newbie
 
Registered: May 2004
Location: France
Distribution: fresh Ubuntu
Posts: 21

Original Poster
Rep: Reputation: 15
so (first, nice: you're my fisrt answer on this forum)

resolv.conf server : the dns IPs of my ISP (free.fr)

nameserver 212.27.39.1
nameserver 212.27.39.2

for my IP address, I've something strange since a new card (it's a laptop), it doesn't state automatically, I put it by hand (but no dhcp)
I do only: ifconfig eth0 192.168.0.222 netmask 255.255.255.0 and my local network is ok

and the nat:

iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS -o ppp0 --clamp-mss-to-pmtu


I repeat that I'm able to ping any web IP from the lan
I probably forget a little stupid detail (as usual)
do you know why dns packets don't go through my nat server (but the others, yes)

thanks for all
 
Old 07-01-2004, 03:27 AM   #4
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 50
Quote:
iptables -A FORWARD -p tcp --tcp-flags SYN,RST SYN -j TCPMSS -o ppp0 --clamp-mss-to-pmtu
should forward udp too for DNS.
 
Old 07-05-2004, 06:44 AM   #5
jobano
LQ Newbie
 
Registered: May 2004
Location: France
Distribution: fresh Ubuntu
Posts: 21

Original Poster
Rep: Reputation: 15
sorry for the late... I had a without linux week end

it's working properly now but I don't know why.
I havent' add any rule in my iptables

the problem source was perhaps inside the routing table (I'm not sure because I thought I had done it last time)
each time I boot, after lauching the web connection, I have to do:

route del default (to remove a default line going through 192.168.0.254)
route add default ppp0

and then it's working properly
an other question now: how can I fix it at boot ? (the routes)


I've notice strange things in my configuration... I have a DHCP server on the same machine (only to set gateway and dns) but theses 'client attributes' have been change automatically ?!? from a static IP to a dynamic name.... ISP ? or linux ?
 
  


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
NAT and DNS Question whohasit Linux - Networking 1 07-19-2005 10:29 PM
SendMail DNS: Service unavailable nutthick Linux - Newbie 1 01-24-2005 09:49 AM
Can't access DNS from PC using NAT/masq wsxyz Linux - Networking 1 01-20-2005 12:20 PM
LVS-NAT for DNS servers freelinuxcpp Linux - Networking 0 07-31-2004 04:52 AM
Manual DNS entries unavailable on MDK 10 FTP install Kujila Mandriva 0 05-08-2004 12:38 PM

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

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