LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Connect a android go device to my computers wifi spot and share the vpn (https://www.linuxquestions.org/questions/linux-newbie-8/connect-a-android-go-device-to-my-computers-wifi-spot-and-share-the-vpn-4175713812/)

linux-man 06-23-2022 11:19 PM

Connect a android go device to my computers wifi spot and share the vpn
 
I need to connect a Android Go device to my computers wifi spot, and then allow the device to only go thru my computers vpn client to the internet.Two articles below relate to the topic of sharing vpn, however I need guidance as I am afraid of doing something detrimental to my computer in terminal. Thanks in advance.

https://askubuntu.com/questions/9261...ther-lan-users
https://kamranzafar.org/2012/08/16/s...tion-on-linux/

business_kid 06-25-2022 04:31 AM

Thanks for the articles - I'm intending to try something similar myself. The sensible way to do it is to get a wired connection for your vpn box, and make the WIFI an access point for the house. Otherwise you'll have endless wifi trouble. I was going to tackle it:
  1. Get a free vpn running on something.
  2. Duplicate it on a box I can leave on 24/7.
  3. Set up wifi access point on the 24/7 box.
  4. Turn off router wifi.
How much of this have you got running?

EDIT:I should say I have a RazPi 4 on here 24/7 running linux to make the rest of what I said intelligible.

linux-man 06-26-2022 03:50 AM

Quote:

Originally Posted by business_kid (Post 6363389)
How much of this have you got running?

None other than working vpn connection and wifi adpater that came with computer.

Code:

cat /proc/sys/net/ipv4/ip_forward  #(this should return `1`)
According to https://askubuntu.com/questions/9261...ther-lan-users I need to start with above code? Would it be harmless to my system if I did?

michaelk 06-26-2022 05:34 AM

Yes, it is basically harmless. ip_forward routes traffic from one interface to another. It is usually set to disable (0) at start so rebooting will restore defaults. To set permanent you need to change the sysctl.conf file.

business_kid 06-26-2022 06:27 AM

Quote:

According to https://askubuntu.com/questions/9261...ther-lan-users I need to start with above code? Would it be harmless to my system if I did?
It' effectively turning your box into a network gateway. And as your traffic goes to the VPN, you get the benefit of the VPN. It's
Code:

echo 1 > /proc/sys/net/ipv4/ip_forward # to set IPV4 forwarding
cat /proc/sys/net/ipv4/ip_forward #Should be 1 if IPV4 forwarding is set


linux-man 06-28-2022 10:00 PM

Should I be expecting something more after the greater than sign?
Code:

$cat /proc/sys/net/ipv4/ip_forward  #(this should return `1`)
0
$echo '1' >> /proc/sys/net/ipv4/ip_forward` 
>
>

I wasn't able to get the name of my built-in wifi adapter to set up the iptables as per point 2 of https://askubuntu.com/questions/9261...ther-lan-users

Code:

$cat /proc/sys/net/ipv4/ip_forward  #(this should return `1`)
0
$echo '1' >> /proc/sys/net/ipv4/ip_forward` 
> ip link
> ifconfig
>


michaelk 06-28-2022 10:47 PM

Without actually seeing the output no one can tell either.
Is the wifi adapter USB or builtin?
If USB post the output of the lsusb command.
If builtin show us the output of the lspci command specific to the wireless adapter.

linux-man 06-29-2022 02:18 AM

Quote:

Originally Posted by michaelk (Post 6364262)
Without actually seeing the output no one can tell either.
Is the wifi adapter USB or builtin?

builtin

Quote:

Originally Posted by michaelk (Post 6364262)
If builtin show us the output of the lspci command specific to the wireless adapter.


Code:

03:00.0 Network controller: Realtek Semiconductor Co., Ltd. RTL8822CE 802.11ac PCIe Wireless Network Adapter

michaelk 06-29-2022 07:49 AM

What distribution are you running? Looks like this wireless adapter needs at least a 5.2 kernel.
https://linux-hardware.org/?id=pci:1...3b-3750&page=1

I don't know if this adapter is capable of being an access point but you can test it via the command

sudo iwconfig <adapter ID> mode master

teckk 06-29-2022 12:49 PM

Quote:

Should I be expecting something more after the greater than sign?
Quote:

echo '1' >> /proc/sys/net/ipv4/ip_forward`
Why is there a lone backtick at the end of the line?
Or is that a typo? That will error.

linux-man 06-29-2022 08:27 PM

Quote:

Originally Posted by michaelk (Post 6364369)
What distribution are you running? Looks like this wireless adapter needs at least a 5.2 kernel.

5.14.0-9parrot1 home edition


Quote:

Originally Posted by michaelk (Post 6364369)
I don't know if this adapter is capable of being an access point

Code:

sudo iwconfig 10ec:c822 mode master
Error for wireless request "Set Mode" (8B06) :
    SET failed on device 10ec:c822 ; No such device.

I assumed 10ec:c822 is the ID as mentioned here https://linux-hardware.org/?id=pci:1...3b-3750&page=1

linux-man 06-29-2022 08:37 PM

Quote:

Originally Posted by teckk (Post 6364430)
Why is there a lone backtick at the end of the line?
Or is that a typo? That will error.

I copied and pasted as is from https://askubuntu.com/questions/9261...ther-lan-users

Without the backtick
Code:

echo '1' >> /proc/sys/net/ipv4/ip_forward
bash: /proc/sys/net/ipv4/ip_forward: Permission denied

What about the ticks on the number one and double greater than signs, should they stay as is?

michaelk 06-29-2022 08:48 PM

The device ID in the old days would be wlan0 with consistent naming it is something like wlxxxxxx.

It the device is recognized correctly it should be seen in the output of iwconfig, ip or ifconfig.

The single quotes around the 1 just prevent the shell from interpreting any special characters. You have to be root or use sudo to write to /proc

Should be a single >. I have never tried to see what happens if you use two.

The > is redirection, a single > over writes the destination file, >> appends.

linux-man 07-02-2022 09:55 PM

Quote:

Originally Posted by michaelk (Post 6364509)
The device ID in the old days would be wlan0 with consistent naming it is something like wlxxxxxx... it should be seen in the output of iwconfig, ip or ifconfig.

Is this it?
Code:

iwconfig
wlan0    IEEE 802.11  ESSID:off/any


michaelk 07-02-2022 10:00 PM

Yes, that is it.


All times are GMT -5. The time now is 04:20 PM.