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

Notices


Reply
  Search this Thread
Old 07-15-2020, 02:10 AM   #1
vsayanam
LQ Newbie
 
Registered: Jan 2009
Posts: 22

Rep: Reputation: 10
Ubuntu 20.04 with Raspberry Pi 3B plus


Recently I tried connecting wlan0 of RPi 3 with Ubuntu-20.04 using Ethernet cable. This is to avoid using wi-fi adapter in the desktop. There are many elaborate suggestions in Google but simple instructions are needed. Using Google and Github postings the following steps were carried out:
1. Set up RPi 3 B+ with mobile hotspot, using built-in wi-fi adapter.
2. Configure RPi's Ethernet adapter as follows:

$sudo nano /etc/network/interfaces.d/eth0

Enter the code as below:

auto eth0
iface eth0 inet static
address 192.168.1.20
netmask 255.255.255.0
Save the code.
3. We now need to forward the ip from wlan0 to eth0. So we enter:

$sudo sysctl -w net.ipv4.ip_forward=1

4. Next, we allow the traffic through firewall:

$sudo iptables -A FORWARD --in-interface eth0 -j ACCEPT
$sudo iptables --table nat -A POSTROUTING --out-interface wlan0 -j MASQUERADE

5, In the desktop or laptop running Ubuntu we enter the Ethernet address as 192.168.1.50, netmask as 255.255.255.0, gateway as 192.168.1.20 (same as given for RPi). This is also possible from CLI as:

$sudo ifconfig eth0 192.168.1.20 netmask 255.255.255.0
$sudo route add default gw 192.168.1.20

This will work until reboot.For permanent setup, please enter:

$sudo sysctl -p /etc/sysctl.conf
$sudo apt install iptables-persistent

I had to reboot a few times to get this working.
 
Old 07-15-2020, 03:09 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,976

Rep: Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337Reputation: 7337
the title is misleading, what you wrote is confusing (at least for me). And finally I have no any idea if you need any help. Do you have an issue to solve?
 
Old 07-15-2020, 05:07 AM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,761

Rep: Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931Reputation: 5931
I agree with pan64 this looks like a guide to setting up the Pi as a WiFi bridge/extension and not a hot spot.
 
  


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: Raspberry Pi: Combine a Raspberry Pi with up to 4 Raspberry Pi Zeros for less than US$50 with the Cluster HAT LXer Syndicated Linux News 0 07-05-2019 12:03 PM
LXer: Big Blue plus Red Hat plus Private Cloud equals Purple Reign? LXer Syndicated Linux News 0 05-13-2011 05:20 PM
How might I Setup Home Web Server plus File Server plus Printer Sharing brindamo Linux - Server 3 01-14-2008 12:48 AM
hollywood plus and NOVA-s Plus PCI nukenuke123 Linux - Hardware 0 03-20-2007 04:18 PM
c when you add a plus and plus it once more dragoon linux Programming 4 12-22-2003 12:23 PM

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

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