LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 03-27-2011, 06:33 PM   #1
aae900
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Rep: Reputation: 0
Angry problem made me tired in RedHat


Hello guys,
I'm a new user of Linux (RedHat 5). So, please help me to fix my problem:

I have 2 different networks:
the first one is gateway machine (eth0), and the second is a private machine (eth1). So, I've configured the iptables and forwarding stuff and when I try to ping google.com on the gateway machine, it works, while it doesn't work on the private network. Note: I am using VmWare
 
Old 03-27-2011, 07:21 PM   #2
aae900
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
I could say that the problem in DNS:

because when I use this command in the private network machine:
nslookup www.google.com , it says connection timed out; no servers could be reached

while in the public one, it works properly.....


who knows how can I fix this problem.
 
Old 03-27-2011, 10:20 PM   #3
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Do you have any NAT rules in your iptables setup to masquerade the private network?
 
Old 03-28-2011, 05:40 AM   #4
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
In addition to Stickman's point about needing to set up masquerading, you will need to turn on ip forwarding. If you search for 'how to share internet connection' you will get plenty of documents telling you how to achieve your goals.

Here is a link from a reputable site.
 
Old 03-28-2011, 08:19 AM   #5
divyashree
Senior Member
 
Registered: Apr 2007
Location: bbsr,orissa,India
Distribution: RHEL5 ,RHEL4,CENT OS5,FEDORA,UBUNTU
Posts: 1,362

Rep: Reputation: 135Reputation: 135
How you configured your gateway ? Its a normal proxy server or a transparent proxy server ?

And are you using Redhat on VMWare ?

Last edited by divyashree; 03-28-2011 at 08:20 AM.
 
Old 03-28-2011, 05:22 PM   #6
aae900
LQ Newbie
 
Registered: Mar 2011
Posts: 3

Original Poster
Rep: Reputation: 0
Hello guys again,
yes, I'm using 2 network adapters on the public machine (the 1st is NAT & I customized the 2nd one with VMnet5), while the network adapter for the second private machine is VMnet5. My vivid problems just in the second private network machine, where I couldn't ping google.com or even resolve the DNS when I use nslookup www.google.com, whereas I can do all these in just the public network machine. I've configured all iptables and forwarding rules, but I am not really sure what is the source of this problem.

so, what is the best and easiest way to copy and paste my findings here, I tried but I also couldn't.
Then, please specify what do you want me to copy to show it here for you guys.
Thanks for your assistance.



Note: this what I used these setups for my configuration:

echo 1 > /proc/sys/net/ipv4/ip_forward

/dev/eth1, to your external network on /dev/eth0.
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
/sbin/iptables -A FORWARD -i eth0 -o eth1 -m state --state RELATED,ESTABLISHED -j ACCEPT
/sbin/iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT





Last edited by aae900; 03-28-2011 at 05:26 PM.
 
Old 03-29-2011, 05:15 AM   #7
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778Reputation: 778
You can add attachments to your post under the 'Go Advanced' tab at the bottom. Then use the paper clip, icon to add your files. You will be limited in the type of files you can add and must give them an extension like .txt, .jpg, .pdf, etc.

Your configuration steps look correct with the possible exception of if you reboot after enabling ip forwarding that it may become disabled. There are ways to more permanently enable this, but it depends on distribution. Next, how have you configured your private (eth1) interface and your other PCs, especially with regards to address and mask? For example, you can use 192.168.0.1, 255.255.255.0. Then on your other PCs that you want to have Internet access via this PC, set something like addr: 192.168.0.2, 255.255.255.0 and very importantly, set the gateway to be 192.168.0.1 (the PC that is sharing the connection).
 
Old 04-11-2011, 10:33 PM   #8
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You might want to put that forwarding config in /etc/sysctl.conf where it's more permanent.
 
  


Reply


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Another network problem (I'm getting tired of mandriva) DesignerX Mandriva 3 04-09-2007 04:00 PM
Tired of trying to rectify the problem with multiple linux booting!!:confused: Azzath Fedora 2 03-16-2005 05:28 AM
custom-made redhat distro srns Red Hat 1 12-15-2004 09:15 PM
starting talk deamon on redhat 9.0 gives a problem , entries were made in xinetd ssharma_02 Linux - Networking 1 09-07-2004 02:23 PM
RedHat got me tired!! Ricio Red Hat 7 10-19-2003 04:36 PM


All times are GMT -5. The time now is 05:01 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration