LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Trying to add a WiFi hot spot to my LAN - routing issue I think. (https://www.linuxquestions.org/questions/linux-networking-3/trying-to-add-a-wifi-hot-spot-to-my-lan-routing-issue-i-think-4175619781/)

taylorkh 12-17-2017 10:48 AM

Trying to add a WiFi hot spot to my LAN - routing issue I think.
 
Here is my network topology:

[DSL Router] <- Ethernet -> [t16] <- Ethernet -> [t15] <- WiFi -> [t21]

Computer t16 runs CentOS 7, two NICs - one to Internet side and the second one "Shared to other computers" per NetworkManager. It's default IP address is 10.42.0.1. The LAN is thus on the 10.42.0 subnet. This computer also provided DHCP for the LAN with reserved addresses for physical machines and dynamic addresses for virtual machines.

Computer t15 also runs CentOS 7. It picks up its reserved address (10.42.0.115) on its Ethernet card. This part works fine and it can communicate with other computers on the LAN.

I enabled the WiFi card in t15 and configured it thus:

[WiFi]
SSID: Gerling
Mode: Hotspot
[Wifi Security]
WPA/WPA2 Personal (set password)
[IPv4 Settings]
Method: Shared to other computers
Address 10.42.0.215 Netmask 255.255.255.0 Gateway 10.42.0.1

Computer t21 is my Raspberry Pi running Ubuntu Mate 16.04. I configured its WiFi connection thus:

[WiFi]
SSID: Gerling
Mode: Client (also tried Adhoc)
[Wifi Security]
WPA/WPA2 Personal (set password)
[IPv4 Settings]
Method: DHCP

These settings seem to connect, at least that message is displayed by the NetworkManager applet. If I look at connection information I see:

[IPv4]
IP Address: 10.42.0.211
Broadcast: 10.42.0.255
Subnet mask: 255.255.255.0
Default Route: 10.42.0.1

This seems to be good (unless I am missing something). However, I cannot ping between t21 and t15. I have also tried manually configuring the address on t21. Same problem. The WiFi connects "mechanically" but I cannot ping between the computers.

In an earlier attempt I configured t15 manually to use the address 10.44.0.1 with the gateway 10.42.0.115 (its Ethernet card). I configured t21 to use 10.44.0.221. In this case I could ping between the computers and I could reach the Internet from t21. However, I could not reach t21 from other computers on my LAN as it was on a different subnet. Therefor I wished to put the WiFi hotspot on the 10.42.0 subnet. I realize I will need to reserve the IP addresses for the hotspot and t21 in my DHCP server so they do not get assigned to something else. First I need to get the hotspot working.

Can anyone point me to what I have done wrong???

TIA,

Ken

p.s. As I was proof reading this post I decided to pull the Ethernet cable from t15. I CAN now ping between t15 and t21. Now I am REALLY confused :scratch:

business_kid 12-17-2017 11:37 AM

You're straying from the beaten path by not having the dhcp on the hotspot, but it doesn't seem to hurt. The output of the route command would be interesting. If dhcp reconfigures routes, even more so.

taylorkh 12-17-2017 01:08 PM

Thanks business_kid,

My eventual goal is to run the hotspot on the t16 computer. At the moment I am just trying to get a handle on tying two computers together with WiFi. Here are the results of route on t15 and t21
Code:

Ethernet wire out on t15

ken@taylor21:~$ route
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
default        10.42.0.1      0.0.0.0        UG    600    0        0 wlan0
10.42.0.0      *              255.255.255.0  U    600    0        0 wlan0
link-local      *              255.255.0.0    U    1000  0        0 wlan0

Ethernet wire in on t15

ken@taylor21:~$ route
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
default        10.42.0.1      0.0.0.0        UG    600    0        0 wlan0
10.42.0.0      *              255.255.255.0  U    600    0        0 wlan0
link-local      *              255.255.0.0    U    1000  0        0 wlan0

t15

Ethernet wire out

[ken@taylor15 ~]$ route
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
default        taylor16        0.0.0.0        UG    600    0        0 wlp2s0
10.42.0.0      0.0.0.0        255.255.255.0  U    600    0        0 wlp2s0

Ethernet wire in

[ken@taylor15 ~]$ route
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
default        taylor16        0.0.0.0        UG    100    0        0 p1p2
default        taylor16        0.0.0.0        UG    600    0        0 wlp2s0
10.42.0.0      0.0.0.0        255.255.255.0  U    100    0        0 p1p2
10.42.0.0      0.0.0.0        255.255.255.0  U    600    0        0 wlp2s0

Note that t15 and taylor15 refer to the same computers etc. - just a little shorthand on my part.

Ken

business_kid 12-17-2017 01:39 PM

I would like to see Something like

My own IP
Internal Network
Other internal Network (if it exists)
Default route

Then anything networked will find itself, the local net, and then use the default which presumably goes to internet. I only see 10.42.0, with 10.42.0.1 as presumably the server. I hope it has alol the answers. I also see interfaces wlan0, p1p2, & wlp2s0. I hope someone knows what they're doing with them, because I don't.

I would chart this on paper, name everything, and get sense out of it that way. What's link-local?

taylorkh 12-17-2017 03:15 PM

Does not 10.42.0.0/255.255.255.0 represent all addresses from 10.42.0.1 to 10.42.0.254? 10.42.0.1 (t16) is the server, router, firewall, shared Internet connection, shared VPN etc. Here is its route (with the VPN disconnected so as not to confuse the picture further
Code:

[ken@taylor16 ~]$ route
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
default        nc-71-0-16-1.dh 0.0.0.0        UG    100    0        0 p1p2
10.42.0.0      0.0.0.0        255.255.255.0  U    100    0        0 enp0s20u1
71.0.16.0      0.0.0.0        255.255.248.0  U    100    0        0 p1p2

p1p2 is the built in Ethernet NIC which connects to the DSL modem and the other is a USB to Ethernet dongle which is shared and connects via a switch to the LAN. This is what route looks like on a machine connected to the LAN
Code:

[ken@vmCentOS7Mate ~]$ route
Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
default        taylor16        0.0.0.0        UG    100    0        0 ens33
10.42.0.0      0.0.0.0        255.255.255.0  U    100    0        0 ens33

Again taylor16 or t16 as I described it earlier is the server, router etc.

It is coming up on time for my end of quarter Clonezilla snapshot of my machines. I may do t16 now and try sharing its WiFi interface and see what happens. Just have to take my whole LAN down for a little while. But then my ISP has a habit of doing that as well :rolleyes:

Ken

business_kid 12-18-2017 03:36 AM

You're right about adressing 10.42.0.0 getting the entire network.

I would start with the hotspot by giving it a 192.168.x.x address, and then it becomes clear which is which at a glance. Things with wired connections should not have hotspot connections, unless there's something wrong with your wire :) That simplifies things. So your network becomes

Code:

Internet <-->10.42.0.1<--> 10.42.x.x Wired Network
                        |
                        |
                  192.168.0.1<-->192.168.x.x Wifi Networks

Then each network gets a route to the other via 10.42.0.1. Will that work? It probably needs a little extra config in whatever you're running in your server. Safer installations involve a DMZ & firewall to cope with security (in and out), but you know that.

taylorkh 12-18-2017 11:51 AM

Thanks once more business_kid. I may try setting up something like that once I configure some more test computers together. I am looking into a couple of other concerns before going too far. I wish to NOT broadcast the SSID - have not found out how to do that and I want to restrict WiFi connection to only selected MAC addresses. I think I can do the latter with firewalld. In the mean time I have the Pi plugged into a spare port on the switch. A LOT simpler.

Ken


All times are GMT -5. The time now is 10:36 PM.