How to access the third computer without a new router
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.
How to access the third computer without a new router
As the topic, there were two computer connect to the only route with IPs: 192.168.1.7(mark as A) and 192.168.1.9[wlan0](mark as B). And there were two ethernet cards hardware installed and I configured the other device's IP as 192.168.1.100[eth0], which directly connects with another machine, whose IP has configured as 192.168.1.200(mark as C).
After I added a new route: sudo route add -host 192.168.1.100 gw 192.168.1.9, I can access the B machine via 192.168.1.100 like 192.168.1.9 perfectly.
However, I want to access machine C. I add a new route: sudo route add -host 192.168.1.200 gw 192.168.1.100, it does not work. So, I try another method, ip forward, I enable ipv4 ip forward first: sudo sysctl net.ipv4.ip_forward=1 and than add entries via iptables: sudo iptables -A FORWARD -i eth0 -o wlan0 -j ACCEPT(i want to enable ping the wlan0 in machine C), iptables -A FORWARD -o eth0 -i wlan0 -m state --state ESTABLISHED,RELATED -j ACCEPT. It doe's not work too.
I still can't access machine C in machine A. Btw, I can't control the router, and also can't connect the three machine to the router directly.
It sounds like you have two networks: a wi-fi network with .7 and .9, and a wired network with .100 and .200, but you are trying to make them one subnet 192.168.1.x. Without some serious network-fu you can't have two separate unbridged networks act as a single subnet.
Better would be to either connect them all to the same bridge (usually routers have some wired ports as well for this), or to make two subnets and have machine B act as a router between them. If the wired networks need to get to the outside world through the wi-fi, then B will need to do SNAT as well.
It sounds like you have two networks: a wi-fi network with .7 and .9, and a wired network with .100 and .200, but you are trying to make them one subnet 192.168.1.x. Without some serious network-fu you can't have two separate unbridged networks act as a single subnet.
Better would be to either connect them all to the same bridge (usually routers have some wired ports as well for this), or to make two subnets and have machine B act as a router between them. If the wired networks need to get to the outside world through the wi-fi, then B will need to do SNAT as well.
Yes, I don't know how to.
btw, Im sorry for late reply because of COVID-19.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.