How to set up alternate LAN access using hotspot
by mfoley from LinuxQuestions.org on (#5ET3R)
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 wlan0If 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 ACCEPTOn "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.66But, it's not working. "server" still can't get out (resolve external domain names) or resolve local host names.
What am I missing?


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 wlan0If 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 ACCEPTOn "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.66But, it's not working. "server" still can't get out (resolve external domain names) or resolve local host names.
What am I missing?