You are not logged in.

#1 2016-06-30 15:30:37

archfluke
Member
Registered: 2016-06-08
Posts: 39

use tethered phone on host for internet only but still access LAN

Hello.  I was wondering how to setup a client/host with Archlinux that's connected to a LAN and is set to be tethered for internet to use the phone exclusively for internet while still having access to the rest of the LAN, which is using the local gateway for its internet.  The subnet on the tethered end would be 192.168.100.0/24, which is different from the subnet used by the rest of the LAN(192.168.1.0/24).  I would appreciate any advice that will allow me to setup the network as such.  Thank you.

Offline

#2 2016-06-30 15:52:47

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 19,770

Re: use tethered phone on host for internet only but still access LAN

Change the default gateway to 192.168.100.1   (you will use the ip route command)

Edit:  Assuming the phone uses 192.168.100.1 as its address.  You might want to check that

Last edited by ewaller (2016-06-30 15:53:32)


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#3 2016-06-30 17:08:03

archfluke
Member
Registered: 2016-06-08
Posts: 39

Re: use tethered phone on host for internet only but still access LAN

excellent.  I never thought of the term "gateway" as being infused with so much meaning until your response.  Thank you.  So I did a duckduckgo hunt for it and found this article http://www.cyberciti.biz/faq/linux-setu … e-command/ and ran route -n:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.100.1    128.0.0.0       UG    0      0        0 tun0
0.0.0.0         192.168.1.1     0.0.0.0         UG    100    0        0 enp0s25
128.0.0.0       192.168.100.1    128.0.0.0       UG    0      0        0 tun0
192.168.2.0     0.0.0.0         255.255.255.0   U     100    0        0 enp0s25
192.168.100.1    0.0.0.0         255.255.255.255 UH    0      0        0 tun0

Tun being the interface of the tethered phone.  So when I connect the ethernet cable that connects to my LAN, my public ip changes from the 89.379.17.73 for my tethered phone to 173.28.283.3 which is the public ip shared by the LAN.  I'm the worst at figuring out how to use the man pages to find the relevant information in a streamlined way since I can't filter the noise from the signal, so to speak. 

From my understanding of the article, I get that this command is what I would need:

route add default gw {IP-ADDRESS} {INTERFACE-NAME}  OR for me
route add default gw 192.168.100.1 enp0s25

This will thereby allow me to completely seal off the gateway access provided by interface enp0s25 while still allowing me to access and be accessed by other clients/hosts on the 192.168.1.0/24 subnet.

If this isn't correct, I was wondering if you could provide any syntactical hints or perhaps even a command to try to set the default gateway on host. I'm not sure if setting the default gateway involves setting the gateway for the enp0s25 interface(my ethernet) and if I choose to use my wifi, to do the same for that.  OR is there a way to set a "master" default gateway for the host as a whole. 

And I'm not sure if this would be totally different thread but I was wondering how I can set it up so that if the tethered network goes down or something, that my archlinux client can switch to use the gateway shared by the LAN as a failover.

Thank you!

Last edited by archfluke (2016-06-30 17:18:18)

Offline

Board footer

Powered by FluxBB