LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   nating problem (https://www.linuxquestions.org/questions/linux-networking-3/nating-problem-448053/)

bondoq 05-24-2006 08:49 AM

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

peter_robb 05-24-2006 09:05 AM

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

jschiwal 05-24-2006 09:15 AM

The other hosts on the network need the eth1 IP address value for the default gateway as well.

bondoq 05-25-2006 04:24 AM

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

peter_robb 05-25-2006 05:10 AM

Cool..

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

Enjoy!

bondoq 05-25-2006 05:25 AM

nating problem
 
my /etc/resolve.conf

search my.domin.com
nameserver 192.168.1.1

peter_robb 05-25-2006 07:41 AM

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


bondoq 05-27-2006 03:04 AM

nating problem
 
i added the ns1 and ns2 ips but still not working

bondoq 05-27-2006 07:02 AM

nating problem
 
thank you peter

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

again i really appreciate your help


All times are GMT -5. The time now is 01:57 PM.