LinuxQuestions.org
Help answer threads with 0 replies.
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
 
LinkBack Search this Thread
Old 05-24-2006, 08:49 AM   #1
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Rep: Reputation: 13
nating problem


hi i am aa linux administrator and i am using fedora core 5 my problem is i can't to make nating in my server so that my lan can access the internet i have 2 nics the first eth0 in connected to the dsl
the second eth1 is conneced the my local network
in linux can access the internet but the local network can't do it

help me plz

thank you in advance
 
Old 05-24-2006, 09:05 AM   #2
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
You need to add an iptables rule to do NATing, eg

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

This works for dynamic ip numbers..
For static ip numbers, eg

iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source yr.ip.num.ber
 
Old 05-24-2006, 09:15 AM   #3
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
The other hosts on the network need the eth1 IP address value for the default gateway as well.
 
Old 05-25-2006, 04:24 AM   #4
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
nating problem

my eth0 is 62.241.153.147

eth1 192.168.1.1
my router 62.241.153.145


after i made the iptables role for nating i can access the internet and my local network can ping eth0,eth1,the router and can ping any host on the internet with the ip only but couldn't ping the host with the name

and when i make command: nslookup in any windows he can't find the name server for the ip 192.168.1.1


thank you
 
Old 05-25-2006, 05:10 AM   #5
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
Cool..

Now you need to add the dns servers for your isp into /etc/resolv.conf

Enjoy!
 
Old 05-25-2006, 05:25 AM   #6
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
nating problem

my /etc/resolve.conf

search my.domin.com
nameserver 192.168.1.1
 
Old 05-25-2006, 07:41 AM   #7
peter_robb
Senior Member
 
Registered: Feb 2002
Location: Szczecin, Poland
Distribution: Gentoo, Debian
Posts: 2,458

Rep: Reputation: 47
It looks like you need the ip numbers for ns1 & ns2..

Code:
 peter ~ # dig -x 62.241.153.147
 
 ; <<>> DiG 9.3.2 <<>> -x 62.241.153.147
 ;; global options:  printcmd
 ;; Got answer:
 ;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 42714
 ;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 2, ADDITIONAL: 2
 
 ;; QUESTION SECTION:
 ;147.153.241.62.in-addr.arpa.   IN      PTR
 
 ;; ANSWER SECTION:
 147.153.241.62.in-addr.arpa. 43200 IN   PTR     host-62-241-153-147.static.link.com.eg.
 
 ;; AUTHORITY SECTION:
 153.241.62.in-addr.arpa. 43200  IN      NS      ns1.link.net.
 153.241.62.in-addr.arpa. 43200  IN      NS      ns2.link.net.
 
 ;; ADDITIONAL SECTION:
 ns1.link.net.           171850  IN      A       213.131.64.2
 ns2.link.net.           171850  IN      A       213.131.64.3
 
 ;; Query time: 272 msec
 ;; SERVER: 194.204.152.34#53(194.204.152.34)
 ;; WHEN: Thu May 25 14:35:02 2006
 ;; MSG SIZE  rcvd: 173
 
Old 05-27-2006, 03:04 AM   #8
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
nating problem

i added the ns1 and ns2 ips but still not working
 
Old 05-27-2006, 07:02 AM   #9
bondoq
Member
 
Registered: Nov 2004
Posts: 77

Original Poster
Rep: Reputation: 13
nating problem

thank you peter

the problem is solved and the internet now is working very good

again i really appreciate your help
 
  


Reply

Tags
dns, iptables, masquerade, resolvconf, snat


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with NATing gpagedar Linux - Networking 5 01-28-2006 08:04 PM
iptables twice nating beno123 Linux - Networking 0 07-27-2005 02:41 AM
IPTables Undesired NATing Wraezor Linux - Security 3 07-15-2005 05:09 AM
IP range nating problem szekelyz Linux - Networking 2 09-03-2003 06:29 PM
Nating ... suvajit Linux - Networking 3 05-15-2003 07:09 AM


All times are GMT -5. The time now is 11:16 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration