Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
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
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.
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
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).