LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-26-2022, 09:43 PM   #1
kcynice
Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 154

Rep: Reputation: 25
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.

Need help, thanks
 
Old 03-27-2022, 10:40 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,153

Rep: Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265Reputation: 1265
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.
 
Old 03-28-2022, 08:21 AM   #3
kermitdafrog8
Member
 
Registered: Dec 2018
Location: Orlando, FL
Distribution: Slackware AARCH64 and X86_64
Posts: 336

Rep: Reputation: Disabled
How to access the third computer without a new router

You probably should use B as a DHCP server for C and have C on a different subnet. Then B can be the gateway between subnets.

Last edited by kermitdafrog8; 03-28-2022 at 08:24 AM.
 
Old 03-29-2022, 08:47 PM   #4
kermitdafrog8
Member
 
Registered: Dec 2018
Location: Orlando, FL
Distribution: Slackware AARCH64 and X86_64
Posts: 336

Rep: Reputation: Disabled
How to access the third computer without a new router

Any luck getting it to work?
 
Old 04-01-2022, 10:44 PM   #5
kcynice
Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 154

Original Poster
Rep: Reputation: 25
Quote:
Originally Posted by smallpond View Post
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.
 
Old 04-01-2022, 10:46 PM   #6
kcynice
Member
 
Registered: Sep 2008
Distribution: Slackware
Posts: 154

Original Poster
Rep: Reputation: 25
Quote:
Originally Posted by kermitdafrog8 View Post
Any luck getting it to work?
No. A and B connected within a DHCP server router, B and C connected directly without a server. thks
 
  


Reply



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
[SOLVED] Old computer can access internet but new computer has not learnt settings from the modem grumpyskeptic Linux - Networking 38 08-24-2021 12:48 AM
no access to config on wired access, but modem/router and wired access point work littlejoe5 Linux - Networking 1 10-22-2014 02:40 PM
How can I remove UBUNTU from my computer. Accidentaly installed without third part. habimana Linux - Newbie 2 02-05-2013 07:37 PM
[SOLVED] Using an Old Computer's HD in New Computer Without Reformat Sylvester Ink Linux - Hardware 9 09-28-2012 08:26 PM
SSH into Third box behind a linksys router. donk3 Linux - Networking 1 09-05-2003 01:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 08:53 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
Open Source Consulting | Domain Registration