LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-21-2017, 04:46 AM   #1
lfslfs
LQ Newbie
 
Registered: Dec 2015
Posts: 28

Rep: Reputation: Disabled
how should I set network sharing for a busybox Linux (no DHCP)?


Hi. I connected a host PC with a raspberry Pi. An Ubuntu runs on the host PC and a busybox runs on the Pi without DHCP.
So I set the Ubuntu should share its own Ethernet connection. Cause the option "make available to other users" is set in default.

Then I set the static IP on the PI. And the gateway(The IP of the host PC).

So I can ping the host PC, but when I tried to ping google DNS: 8.8.8.8. It says:
12 packets transmitted, 0 packets received, 100% packet loss

I am bit confused. what else should be done?
 
Old 09-21-2017, 09:10 PM   #2
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian Stable
Posts: 2,546
Blog Entries: 8

Rep: Reputation: 465Reputation: 465Reputation: 465Reputation: 465Reputation: 465
Go to the Ubuntu network manager settings, and edit the Wired Connection. Go to IPv4 settings, and change the connection method to "Shared to other computers".

Then, on the Raspberry Pi, make sure to set a static IP in the range defined by the host PC's shared internet connection settings (if you don't know what these are, then set it to 10.42.0.2 - you can replace "2" with a number between 2 and 254). For the gateway, set it to the host PC's wired connection IP address, not the IP address it is using on its WiFi connection (or other ethernet device). If you don't know what this is, then it is 10.42.0.1

Basically, the "Shared to other computers" connection method turns your computer into a simple router. In older version of Network Manager, there was no configuration possible on this - it invariably used 10.42.0.1 as the local IP address with a subnet of 10.42.0.X. In current versions, you can optionally set a different IP address and subnet.
 
Old 09-22-2017, 02:53 AM   #3
lfslfs
LQ Newbie
 
Registered: Dec 2015
Posts: 28

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by IsaacKuo View Post
Go to the Ubuntu network manager settings, and edit the Wired Connection. Go to IPv4 settings, and change the connection method to "Shared to other computers".

Then, on the Raspberry Pi, make sure to set a static IP in the range defined by the host PC's shared internet connection settings (if you don't know what these are, then set it to 10.42.0.2 - you can replace "2" with a number between 2 and 254). For the gateway, set it to the host PC's wired connection IP address, not the IP address it is using on its WiFi connection (or other ethernet device). If you don't know what this is, then it is 10.42.0.1

Basically, the "Shared to other computers" connection method turns your computer into a simple router. In older version of Network Manager, there was no configuration possible on this - it invariably used 10.42.0.1 as the local IP address with a subnet of 10.42.0.X. In current versions, you can optionally set a different IP address and subnet.
hi Issac, I think I missed one thing. In my version of Ubuntu, there's no such option as "Shared to other computers"
Under iPc4 setting, there's only User this connection only for resources on its network. I do not know if it means the same?
 
Old 09-22-2017, 04:15 AM   #4
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
Idk GUI, but does the Ubu box get to the internet by wifi (or other wired nic)?
If so, maybe you need the kernel setting of ip forwarding, to act as router.
(For more details, web-search fastest) tcpdump to debug

Last edited by !!!; 09-22-2017 at 04:17 AM.
 
Old 09-22-2017, 07:26 AM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,521

Rep: Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843
What version of Ubuntu are you running? Make available to other users is not the same thing as connection sharing.

Does your Network Manager look similar?

https://askubuntu.com/questions/1694...wired-ethernet
 
Old 09-22-2017, 07:32 AM   #6
lfslfs
LQ Newbie
 
Registered: Dec 2015
Posts: 28

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
What version of Ubuntu are you running? Make available to other users is not the same thing as connection sharing.

Does your Network Manager look similar?

https://askubuntu.com/questions/1694...wired-ethernet
Hi. my ubuntu is 17.4 and it looks quite different from this. This is also what made me feel pretty weird.
 
Old 09-22-2017, 07:34 AM   #7
lfslfs
LQ Newbie
 
Registered: Dec 2015
Posts: 28

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by !!! View Post
Idk GUI, but does the Ubu box get to the internet by wifi (or other wired nic)?
If so, maybe you need the kernel setting of ip forwarding, to act as router.
(For more details, web-search fastest) tcpdump to debug
oh. I am not ready for the kernel compilation. I mean I thought the PC version should have already enabled enough options for me....
 
Old 09-22-2017, 11:25 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,521

Rep: Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843
While the applet is updated the settings as described in the link should still be the same.

So I assume that your host PC is wireless and that you want to share the internet via its ethernet connection.

Does the Pi have a defined route?

Last edited by michaelk; 09-22-2017 at 11:28 AM.
 
Old 09-22-2017, 03:42 PM   #9
lfslfs
LQ Newbie
 
Registered: Dec 2015
Posts: 28

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
While the applet is updated the settings as described in the link should still be the same.

So I assume that your host PC is wireless and that you want to share the internet via its ethernet connection.

Does the Pi have a defined route?

The PC is connected to the internet via Ethernet and the connection between Pi and PC is a USB-Ethernet.
The Pi does not have DHCP and I just set the static IP of the Pi and the IP of the USB-Ethernet of the PC under the same sub-net. So I can ping the Pi from the PC and vise versa.
But I cannot let the Pi share the internet of the PC.
 
Old 09-22-2017, 04:00 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,521

Rep: Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843
When you edit the connection settings for the USB ethernet under IPV4 is there a method pull down menu like in the link I posted?
 
Old 09-23-2017, 04:55 PM   #11
lfslfs
LQ Newbie
 
Registered: Dec 2015
Posts: 28

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by michaelk View Post
When you edit the connection settings for the USB ethernet under IPV4 is there a method pull down menu like in the link I posted?
Nope. This is also the thing that confused me for long. Cause before I post this, I've already searched for it. But in my case, there's no such option...
 
Old 09-23-2017, 05:22 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,521

Rep: Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843Reputation: 5843
Interesting. I ran standard Ubuntu 17.4 as a Virtual Machine with a USB ethernet adapter and it was just as described. My connection naming will be different then yours and I did not actually configure it for sharing.
 
Old 09-23-2017, 06:32 PM   #13
!!!
Member
 
Registered: Jan 2017
Location: Fremont, CA, USA
Distribution: Trying any&ALL on old/minimal
Posts: 997

Rep: Reputation: 382Reputation: 382Reputation: 382Reputation: 382
I'm not sure if this is what's needed, but here's what I thought of:

echo 1 > /proc/sys/net/ipv4/ip_forward

https://askubuntu.com/questions/2273...ard-ip-packets
https://unix.stackexchange.com/quest...-ip-forwarding

Last edited by !!!; 09-23-2017 at 07:14 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
where can set Network name on Linux Centos Dhcp Server Aneesh.T .S Linux - Newbie 1 11-22-2012 10:00 AM
Network manager does not set hostname received from DHCP server Pemek Linux - Networking 1 01-30-2012 07:44 AM
Linux DHCP client unsuccessful on a windows DHCP served network tom1080 Linux - Newbie 1 12-16-2009 12:37 PM
How do I set up network printer sharing? suicidle_p0ptart Linux - Networking 2 11-22-2006 05:07 AM
How do i install a network card/drivers or set up internet connection sharing? Daz155HGT Linux - Newbie 1 04-20-2004 06:22 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

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