LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-01-2021, 01:06 PM   #1
mfoley
Senior Member
 
Registered: Oct 2008
Location: Columbus, Ohio USA
Distribution: Slackware
Posts: 2,586

Rep: Reputation: 179Reputation: 179
How to set up alternate LAN access using hotspot


Occasionally my Internet provider, Spectrum, drop out for an annoyingly long period, usually when I'm in the middle of writing a program remotely. I have the following configuration:

host "quadmon" - local Slackware-Current computer used for human interaction. IP 192.168.0.17

host "server" - local Linux file server and email server. IP 192.168.0.15

router: Asus RT-AC66U B1 configured as the gateway and name server. IP 192.168.0.1

When I lose Internet connection I want to be able to connect using my smart phone hot spot. That's easy enough on "quadmon" as I have a wireless dongle plugged in there and it connects just fine. I can connect to the Internet from there. It's IP is then (e.g.) 192.168.43.66 and 'route' gives:
Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         192.168.43.1    0.0.0.0         UG    303    0        0 wlan0
loopback        0.0.0.0         255.0.0.0       U     0      0        0 lo
192.168.0.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
192.168.43.0    0.0.0.0         255.255.255.0   U     303    0        0 wlan0
If I modify quadmon's inet1.conf to hard-code the eth0 interface to 192.168.0.17 (normally, it is DHCP="yes"), I can then connect to "server" at 192.168.0.15 (wired).

My problem is that "server" cannot connect to the Internet since it is wired and relying on the now disconnected ASUS router for everything. I'd like to configure "quadmon" as the router/gateway. I've tried the following:

On "quadmon" /proc/sys/net/ipv4/ip_forward = 1. inet1.conf is:
Code:
IPADDR[0]="192.168.0.17"
NETMASK[0]="255.255.255.0"
IPALIASES[0]=""
USE_DHCP[0]="no"

IFNAME[4]="wlan0"
USE_DHCP[4]="yes"
WLAN_WPA[4]="wpa_supplicant"
and iptables has:
Code:
iptables --table nat --append POSTROUTING --out-interface wlan0 -j MASQUERADE
iptables --append FORWARD --in-interface eth0 -j ACCEPT
On "server", I changed the inet1.conf to:
Code:
IPADDR[0]="192.168.0.15"
NETMASK[0]="255.255.255.0"
USE_DHCP[0]="no"

# The following is the IP of "quadmon"
GATEWAY="192.168.43.66"
I change /etc/resolv.conf to:
Code:
nameserver 192.168.43.66
But, it's not working. "server" still can't get out (resolve external domain names) or resolve local host names.

What am I missing?

Last edited by mfoley; 03-01-2021 at 01:09 PM.
 
Old 03-01-2021, 09:18 PM   #2
mralk3
Slackware Contributor
 
Registered: May 2015
Distribution: Slackware
Posts: 1,904

Rep: Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053Reputation: 1053
Maybe I've misread, but I have a few suggestions.

You need to make sure your /etc/resolv.conf is reflecting the dns settings of your hotspot and also glance over /etc/hosts. You can also save yourself some trouble and use the hostapd SlackBuild. It will let you easily configure a hotspot. After that you can add dnsmasq for DNS if you value DNSSEC or other protections. DHCPCD is overkill for this, so also configure dnsmasq to serve dhcp. If you do not want to bother with dnsmasq, then set your interfaces to static IP addresses (as you've done). As far as I know, wpa_supplicant is just used to set up client machines.

https://slackbuilds.org/repository/1...search=hostapd

There are some security advisories for hostapd listed here: https://w1.fi/security/2021-1/ and here: https://w1.fi/security/2020-2/ Just drop the patches as is into the "patches" directory of the SlackBuild. Or just use it as is. I run my home gateway wireless access point 24x7 for the last 4 years with hostapd.
 
Old 03-01-2021, 10:30 PM   #3
baumei
Member
 
Registered: Feb 2019
Location: USA; North Carolina
Distribution: Slackware 15.0 (replacing 14.2)
Posts: 365

Rep: Reputation: 124Reputation: 124
I suggest getting a 'wireless client to ethernet' adapter. Configure this adapter to connect wirelessly to the hotspot on your telephone, and plug the ethernet cable from the adapter to the WAN port of your ASUS router.

If the ASUS router provides ALL the domain name resolution for the LAN, then everything should be working --- however, if the hosts on the LAN are configured to use the Spectrum DNS servers, then while the LAN is connected to the hotspot those Spectrum DNS entries will probably need to be removed from the /etc/resolv.conf file of the hosts.
 
  


Reply

Tags
nameserver, routing, slackware 14.2



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
access alternate port on LAN mk27 Linux - Networking 2 04-09-2011 11:47 AM
Need help to migrate from mikrotik hotspot to Linux Hotspot for I-net cafe.. thewhitelion Linux - Server 4 10-31-2007 03:47 AM
Need help to migrate from mikrotik hotspot to Linux Hotspot for I-net cafe.. thewhitelion Linux - Enterprise 5 10-03-2007 05:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 08:37 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