Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have just installed fedora core 5 in a machine (referred as M-5 hereinafter), and fedora core 6 (referred as M-6) in another machine. Both of these machines are connected directly with a crossover cable. I want to share my internet connection over my two machines network. The M-6 have two NICs, one is connected with a DSL (dynamic IP) internet connection (eth0), and the other NIC (eth1) is directly connected with the other machine's (M-5) NIC (eth0) with that corssover cable.
The file /etc/sysconfig/network for M-6 added with the following string,
Code:
GATEWAYDEV=ppp0
and the same file for M-5 added with
Code:
GATEWAY=192.168.0.1 //(which is the IP address of eth1 of M-6)
It can be mentioned here that I can ping well between the machines. I also changed /etc/sysctl.conf file, from net.ipv4.ip_forward=0 to net.ipv4.ip_forward=1.
Masquerade the internet connection,
Code:
iptables -t nat -A POSTROUTING -o ppp0 -j MASQUERADE
iptables -A FORWARD -s 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -d 192.168.0.0/24 -j ACCEPT
iptables -A FORWARD -s ! 192.168.0.0/24 -j DROP
saved the file
Code:
service iptable save
restarted network and iptables.
Still I am not getting net connection to the other machine. Please guide me, what mistake I am doing to share the internet connection, treating me a newbie.
There you see, look you have been running a default iptables firewall & with this we have to allow packets to traverse through the FORWARD chain (NATed packets exclusively)- because right now all the packets are being dropped. Wait i had already replied to one same query. I'll search its link & pass you on.
What happnd ? Why aint you did the way i have mentioned in that thread ?
Have you removed that script (default one) ? Your FORWARD chain default policy is still drop.
Amit,
it was just a try to stopping the firewall and SELinux. Though, from the out put, it is clear that I was not right, stopping the firewall and SELinux. I'll let you know the result of the thread you have given to me in the evening (after returning from my office).
Last edited by anindyanuri; 01-10-2007 at 07:28 PM.
Anindyanuri,
1. You got to modify those network entries. Those were configured for that thread & since you are not using 192.168.1.x network, you should replace it with your own.
2. Make sure that you do run that NATing rule as well for masquerading (specified in your own first post).
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.