LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 12-22-2020, 09:39 AM   #1
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 145

Rep: Reputation: 15
Route or bridge between two networks


I'm not quite sure of the question I should be asking. It may be a routing or a bridge problem.

I have a network that hangs off my internet router with addresses in the 192.168.1.0/24. The router handles the DHCP stuff and allocates numbers to computers on this network.

One of these computers operates a WiFi hotspot and allocates numbers in the 10.1.230.0/24 range to stuff on the WiFi.

If a tablet or something connects to the WiFi, then it gets a 10.1.239.0/24 number and then goes out over the 192.168.1.0/24 network to the internet and back because I have 'net.ipv4.ip_forward=1' set in the hotspot. At least, I think that is why it works.

Anyway, it works. So far so good.

Now I am starting get IoT gadgets connecting to the WiFi and as some of these have embedded web-server pages, I'd like to be able to sit at my desktop computer on the 192.168.1.0/24 network, and have a look at these pages even though they are on the 10.1.239.0/24 network. I am not sure how to achieve this.

Do I need to set up a route, or is it a bridge, or even something else I need ? I've never dealt with bridges before but from what I have read it involves loosing the I/P address at some stage during setup, and as the hotspot has neither a keyboard or screen, I'm a little wary of just seeing what happens if I try things out.

Some guidance is needed here.

Thanks.
 
Old 12-22-2020, 01:08 PM   #2
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,151
Blog Entries: 6

Rep: Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835Reputation: 1835
Quote:
I'd like to be able to sit at my desktop computer on the 192.168.1.0/24 network, and have a look at these pages even though they are on the 10.1.239.0/24 network
192.168.1.0/24 will reach 192.168.1.0 - 192.168.1.255
https://en.wikipedia.org/wiki/CIDR

In my opinion it would be easier to make 2 subnets closer to each other so that they can reach each other.

Desktop
192.168.0.0/23

IoT thing can be reached at
192.168.1.0 - 255

Check that with
Code:
nmap -sL 192.168.0.0/23
 
Old 12-22-2020, 01:58 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,777

Rep: Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935Reputation: 5935
You probably want a bridge setup.

https://wiki.archlinux.org/index.php...e_access_point
 
Old 12-23-2020, 06:04 AM   #4
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 145

Original Poster
Rep: Reputation: 15
Thanks for the replies.

I'm not sure I want to go down the route of the 192.168.0.0/23 type network with 198.168.0 on the Wifi and 192.168.1 on the router, because the WiFi hotspot is open so anyone can connect. So there's a security issue.

I'm looking into just adding a specfic route to get to one address at the moment.
 
Old 12-23-2020, 06:39 AM   #5
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,347

Rep: Reputation: Disabled
Quote:
Originally Posted by Mike Davies View Post
I'm looking into just adding a specfic route to get to one address at the moment.
Routes are not security barriers.

The way you describe your setup, you have two routers: The router from your ISP (the "Internet router") and a PC running a wireless hotspot.

Since the hotspot users on the 10.1.239.0/24 network access the Internet via your internal LAN (192.168.1.0/24), they already have full access to all computers on the LAN. Or to be exact, they have the same access to the LAN as they do the Internet.

The reason this works at all, is that the AP-managing PC is NATing traffic from the WLAN behind its own address in the 192.168.1.0/24 network. Otherwise, the ISP router wouldn't know where to send the reply packets, since it knows nothing about the 10.1.239.0/24 network.

The reverse, however, is not true: Any attempt to reach an address in the 10.1.239.0/24 network from 192.168.1.0/24 will go to the ISP router, which will either discard the packet or attempt to forward it to the upstream router at the ISP, where it will be summarily dropped.

Adding a route to a PC on the 192.168.1.0/24 network may or may not enable it to reach a host on the 10.1.239.0/24 network, depending on how the AP-managing PC is configured. And in any case, if that PC gets its IP via DHCP, there's an excellent chance the route will stop working at some indeterminate point in the future if/when the PC gets assigned a new IP.

The proper way to design a multi-zone network is to connect each network to a separate interface on a firewall. In a pinch, you could route outbound traffic from a secure zone through a less secure zone, assuming that the traffic is encrypted and/or not of a sensitive nature, but doing it the other way around just isn't a good idea.

Is the "hotspot PC" running Linux? If so, it could easily be used as a firewall.
 
Old 12-23-2020, 08:16 AM   #6
Mike Davies
Member
 
Registered: Jul 2004
Distribution: Custom Linux, Buildroot, Busybox, Fedora, Raspberry Pi
Posts: 145

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Ser Olmy View Post
Routes are not security barriers.

Since the hotspot users on the 10.1.239.0/24 network access the Internet via your internal LAN (192.168.1.0/24), they already have full access to all computers on the LAN. Or to be exact, they have the same access to the LAN as they do the Internet.
Blimey. You are right.

As a quick fix, I plugged a WiFi dongle into my desktop, connected to the hotspot and then unplugged the ethernet cable. You are right, I can still connect to the computers in the wired network.

The hot spot is a linux machine. It currently has some firewall rules. Looks like I will have to tighten them up.
 
  


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
Packet going out of wrong interface due to OS adding cache route - OS trying to route through default route msr1981 Linux - Networking 2 10-11-2017 02:58 PM
Packet going out of wrong interface due to OS adding cache route - OS trying to route through default route msr1981 Red Hat 1 10-09-2017 05:45 AM
vpn-vpn Bridge between two networks (1x Debian Server, 1x Cisco RVS4000) qawse Linux - Networking 2 01-14-2011 01:16 AM
I am bridging 2 networks, but only want the Bridge machine to see both networks. themrrobert Linux - Networking 1 02-17-2009 12:40 PM
I am not able to add a new route to my route table using route command prashanth s j Linux - Networking 2 09-03-2005 04:34 AM

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

All times are GMT -5. The time now is 07:39 PM.

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