LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-23-2022, 11:19 PM   #1
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Rep: Reputation: Disabled
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/

Last edited by linux-man; 06-24-2022 at 03:31 AM.
 
Old 06-25-2022, 04:31 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,404

Rep: Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337
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.

Last edited by business_kid; 06-25-2022 at 10:08 AM.
 
Old 06-26-2022, 03:50 AM   #3
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by business_kid View Post
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?

Last edited by linux-man; 06-26-2022 at 05:32 AM.
 
Old 06-26-2022, 05:34 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
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.
 
Old 06-26-2022, 06:27 AM   #5
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,404

Rep: Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337Reputation: 2337
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

Last edited by business_kid; 06-26-2022 at 10:07 AM.
 
Old 06-28-2022, 10:00 PM   #6
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Original Poster
Rep: Reputation: Disabled
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
>

Last edited by linux-man; 06-28-2022 at 10:02 PM.
 
Old 06-28-2022, 10:47 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
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.
 
Old 06-29-2022, 02:18 AM   #8
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
Without actually seeing the output no one can tell either.
Is the wifi adapter USB or builtin?
builtin

Quote:
Originally Posted by michaelk View Post
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
 
Old 06-29-2022, 07:49 AM   #9
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
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
 
Old 06-29-2022, 12:49 PM   #10
teckk
LQ Guru
 
Registered: Oct 2004
Distribution: Arch
Posts: 5,146
Blog Entries: 6

Rep: Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834Reputation: 1834
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.
 
Old 06-29-2022, 08:27 PM   #11
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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 View Post
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
 
Old 06-29-2022, 08:37 PM   #12
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by teckk View Post
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?
 
Old 06-29-2022, 08:48 PM   #13
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
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.

Last edited by michaelk; 06-29-2022 at 09:36 PM.
 
1 members found this post helpful.
Old 07-02-2022, 09:55 PM   #14
linux-man
Member
 
Registered: Nov 2016
Location: Geneva
Distribution: native install of Parrot Home Edition 5.0 Debian (no security tools) 64 bit, KDE, 5.14.0-9parrot1,
Posts: 872

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
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
 
Old 07-02-2022, 10:00 PM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,760

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
Yes, that is it.
 
  


Reply



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
LXer: Hot not-Spot-bot spot: The code behind Xiaomi's CyberDog? Ubuntu LXer Syndicated Linux News 0 12-04-2021 01:06 PM
Ubuntu 20LTS dual boot Laptop Dell Inspiron 5548 I can not turn on wifi and in wifi settings indicates no wifi device was found Shra94 Linux - Hardware 1 05-19-2020 04:22 PM
Want to share my wifi by creating a wifi hotspot ( While staying connected to wifi)? shadyXV Linux - Desktop 4 07-20-2015 05:37 PM
Linux mint 12 will not connect to wifi internet or android wifi tethers wilspeak Linux - General 4 06-06-2012 12:40 AM
Organize, Enjoy, and Share Your Photos with F-Spot jeremy LQ Articles Discussion 0 12-06-2007 08:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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