[SOLVED] how to connect two networks using 2 NIC linux pc
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.
hi,
We have two networks,one is 10.0.0.* with mask 255.255.255.0 & the other 20.0.0.* with mask 255.255.255.0 and one linux(RHEL5) PC with two network interface eth0,eth1.(configured as Router)
eth0 is 10.0.0.1 and eth1 is 20.0.0.1
we have enabled IP_Forward using "sysctl w net.ipv4.ip_forward=1"
cat /proc/sys/net/ipv4/ip_forward is 1
but unable to ping from one network to other network.
two networks are connected to Linux PC.(10.0.0.1 & 20.0.0.1)
still wht configuration required to establish the connection between two networks using LINUX PC.
from router(linux PC) both network PC's are pinging but not from one network to other network.
i am able to ping router IP 10.0.0.1 from 10.0.0.*
20.0.0.1 from 20.0.0.*
20.0.0.* to 10.0.0.1
10.0.0.* to 20.0.0.1
but unable to ping 10.0.0.* to 20.0.0.*
I think what you have to do is to create a route saying that if something comes to 10.0.0.* it should go to eth0 and if something comes to 20.0.0.* it should go to eth1.
Imagine you have to groups separated by river. You need a bridge to let the people go from one side to the other. It's the same with your two interfaces.
Please, on root console type:
iptables
and twice press on TAB button, bash should give you choices among them should be "iptables-save"
Execute it on root console. We need to know all iptable rules, and FORWARD chain as well. Because forward chain will be used to transfer packets between interfaces.
Also please post output WITHOUT any private ip addresses of:
route -n
Thanks for reply..
problem got solved..i have not added default route in client PC's
After adding default route as
10.0.0.* computers--> route add default 10.0.0.1 netmask 255.0.0.0
20.0.0.* computers--> route add default 20.0.0.1 netmask 255.0.0.0
finally my setup is working...
is there any way to establish connection between networks without adding default route.
dynamic routing.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.