LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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-22-2018, 11:07 PM   #1
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Rep: Reputation: 56
network sharing without router


Hi all,

How to build network sharing without router?

OS: Ubuntu 18.04.1/16.04.5 desktop

Oracle - VirtualBox

Connection:
FTTH
-> ONT (Optical Network Terminal)
-> 4 ports (for connecting computers)

Computer 1
⟫ ifconfig
Code:
eth0      Link encap:Ethernet  HWaddr f0:79:59:65:2f:bb  
          inet addr:42.2.2.2  Bcast:42.2.2.255  Mask:255.255.255.0
          inet6 addr: fe80::b7ec:1609:53c6:bda8/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:97 errors:0 dropped:0 overruns:0 frame:0
          TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8382 (8.3 KB)  TX bytes:14122 (14.1 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:213 errors:0 dropped:0 overruns:0 frame:0
          TX packets:213 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1 
          RX bytes:16024 (16.0 KB)  TX bytes:16024 (16.0 KB)
Computer 1
⟫ ifconfig
Code:
enp2s0    Link encap:Ethernet  HWaddr 50:46:5d:54:bf:ac  
          inet addr:42.2.2.54  Bcast:42.2.2.255  Mask:255.255.255.0
          inet6 addr: fe80::920b:f080:170e:b4c6/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19 errors:0 dropped:0 overruns:0 frame:0
          TX packets:62 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:2449 (2.4 KB)  TX bytes:7496 (7.4 KB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:204 errors:0 dropped:0 overruns:0 frame:0
          TX packets:204 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:15159 (15.1 KB)  TX bytes:15159 (15.1 KB)

On a brief searching I found following document;
Internet/ConnectionSharing
https://help.ubuntu.com/community/In...nectionSharing

Would it be relevant? Or is there a better solution?

Please advise. Thanks

Regards
satimis
 
Old 09-23-2018, 12:30 AM   #2
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
The two computers share the 42.2.2.0/24 network already.

I am not certain I understand you. Where does Virtualbox come in? Are computer1 and computer2 physical machines or virtual machines?

The page that you link to starts as follows:
Quote:
Internet Connection Sharing (ICS) provides the ability for one computer to share its Internet connection with another computer.
If that is what you want, the page is relevant. I suppose the methods for Ubuntu 16 also work for Ubuntu 18. Strictly speaking, the answer to your question (network sharing without a router) is no, since a router will be set up in the computer that is connected to the internet.
 
Old 09-23-2018, 06:44 AM   #3
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by berndbausch View Post
The two computers share the 42.2.2.0/24 network already.

I am not certain I understand you. Where does Virtualbox come in? Are computer1 and computer2 physical machines or virtual machines?

The page that you link to starts as follows:


If that is what you want, the page is relevant. I suppose the methods for Ubuntu 16 also work for Ubuntu 18. Strictly speaking, the answer to your question (network sharing without a router) is no, since a router will be set up in the computer that is connected to the internet.
Hi,

Thanks for your advice and sorry for not explaining clear on my original posting.

The 2 computers mentioned are host of VirtualBox. I'm looking for a solution to set up bridge networking for VMs which are virtual computers.

Can I use that article for setting up bridge networking?

Or I have to build a virtual router on a VM?

How to Configure Ubuntu as a Router
https://opensourceforu.com/2015/04/h...u-as-a-router/

Thanks

Regards
satimis
 
Old 09-23-2018, 09:43 AM   #4
berndbausch
LQ Addict
 
Registered: Nov 2013
Location: Tokyo
Distribution: Mostly Ubuntu and Centos
Posts: 6,316

Rep: Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002Reputation: 2002
Quote:
Originally Posted by satimis View Post
Hi,

The 2 computers mentioned are host of VirtualBox. I'm looking for a solution to set up bridge networking for VMs which are virtual computers.
If you set up bridge networking, you basically extend the external network to the virtual machines. That is, they will attempt to get an IP address from the same source as the two hosts, and they will get addresses from the same 42.2.2.0/24 range. If that is OK, you are done without any further configuration.

If that is not OK, a bridge to the existing 42.2.2.0/24 network is not the right option. You will have to set up your own network to which you then connect the VMs. But this requires a router, either a separate box (not expensive these days), or you use one of the PCs as router. However, the router needs two NICs, e.g. wired and wireless. In this case the document you found earlier should be helpful.

The internet is full of instructions how set up your own network and route it to the internet. The problem is that I don't quite understand what is your goal.
 
Old 09-23-2018, 09:56 AM   #5
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by satimis View Post
Hi,
Thanks for your advice and sorry for not explaining clear on my original posting.

The 2 computers mentioned are host of VirtualBox. I'm looking for a solution to set up bridge networking for VMs which are virtual computers. Can I use that article for setting up bridge networking? Or I have to build a virtual router on a VM?

How to Configure Ubuntu as a Router https://opensourceforu.com/2015/04/h...u-as-a-router/
Sounds familiar: From four years ago, https://www.linuxquestions.org/quest...on-4175498738/

You *STILL*, after fifteen years and over 3,600 posts, do not provide details or ask a clear question when posting. And someone with fifteen years experience should know what berndbausch told you: all of these systems are on the same network. What 'routing' do you expect to need?? What are you actually trying to DO??? By default, all systems on a single LAN can see each other...you only need a router to go OUTSIDE that LAN to other networks, which is where the 'routes' come in.

You've asked about such things numerous times in the past, along with HAProxy, to perform such tasks. Are you unable to look at your previous threads/answers??
 
Old 09-23-2018, 10:50 AM   #6
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by berndbausch View Post
If you set up bridge networking, you basically extend the external network to the virtual machines. That is, they will attempt to get an IP address from the same source as the two hosts, and they will get addresses from the same 42.2.2.0/24 range. If that is OK, you are done without any further configuration.
Thanks for your advice.

Bridged networking with router

Host
/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

# add bridge ports
auto br0
iface br0 inet static
        address         192.168.8.4
        dns-nameservers 218.xxx.xxx.xxx 219.xx.xx.xx
        network         192.168.8.0
        netmask         255.255.255.0
        broadcast       192.168.8.255
        gateway         192.168.8.1
        bridge_ports    eth0
        bridge_fd       9
        bridge_hello    2
        bridge_maxage   12
        bridge_stop     off
Whether replace
address 192.168.8.4 with
Code:
address 42.2.2.2
?

replace
network 192.168.8.0 with
Code:
network 42.2.2.0
?

replace
broadcast 192.168.8.255 with
Code:
broadcast 42.2.2.255
?

replace
gateway 192.168.8.1 with
Code:
gateway 42.2.2.1
?

Quote:
If that is not OK, a bridge to the existing 42.2.2.0/24 network is not the right option. You will have to set up your own network to which you then connect the VMs. But this requires a router, either a separate box (not expensive these days), or you use one of the PCs as router. However, the router needs two NICs, e.g. wired and wireless. In this case the document you found earlier should be helpful.
Although I have spare components to build a PC with 2 NICs, I prefer to purchase a router instead which is inexpensive today. The only problem is needing a spare socket to plug in its adapter (power supply).

Quote:
The internet is full of instructions how set up your own network and route it to the internet. The problem is that I don't quite understand what is your goal.
Actually I only need a bridged network for the VMs

Regards
satimis

Last edited by satimis; 09-23-2018 at 10:52 AM.
 
Old 09-23-2018, 11:05 AM   #7
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by satimis View Post
Thanks for your advice.
Bridged networking with router

Host
/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

# add bridge ports
auto br0
iface br0 inet static
        address         192.168.8.4
        dns-nameservers 218.xxx.xxx.xxx 219.xx.xx.xx
        network         192.168.8.0
        netmask         255.255.255.0
        broadcast       192.168.8.255
        gateway         192.168.8.1
        bridge_ports    eth0
        bridge_fd       9
        bridge_hello    2
        bridge_maxage   12
        bridge_stop     off
Whether replace
address 192.168.8.4 with
Code:
address 42.2.2.2
?
replace network 192.168.8.0 with
Code:
network 42.2.2.0
?
replace broadcast 192.168.8.255 with
Code:
broadcast 42.2.2.255
?
replace gateway 192.168.8.1 with
Code:
gateway 42.2.2.1
?

Although I have spare components to build a PC with 2 NICs, I prefer to purchase a router instead which is inexpensive today. The only problem is needing a spare socket to plug in its adapter (power supply). Actually I only need a bridged network for the VMs
Sorry, but did you not understand what you've been told??? why are you purchasing ANYTHING to do this, when you've been told plainly you **NEED TO DO NOTHING** to have these systems on the same network??

AGAIN: you say "I only need a bridged network for the VM's"....so you're saying your DONE. Set both up with addresses on the same network; finished. After fifteen years and MANY times asking about such things, these things should be obvious.
 
Old 09-23-2018, 11:18 AM   #8
satimis
Senior Member
 
Registered: Apr 2003
Posts: 3,695

Original Poster
Rep: Reputation: 56
Quote:
Originally Posted by TB0ne View Post
Sorry, but did you not understand what you've been told??? why are you purchasing ANYTHING to do this, when you've been told plainly you **NEED TO DO NOTHING** to have these systems on the same network??

AGAIN: you say "I only need a bridged network for the VM's"....so you're saying your DONE. Set both up with addresses on the same network; finished. After fifteen years and MANY times asking about such things, these things should be obvious.
Sorry. I need to explain in more detail.

In my old FTTH plan the ONT came with a built-in router. Following configure worked without problem

Host
/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

# add bridge ports
auto br0
iface br0 inet static
        address         192.168.8.4
        dns-nameservers 218.xxx.xxx.xxx 219.xx.xx.xx
        network         192.168.8.0
        netmask         255.255.255.0
        broadcast       192.168.8.255
        gateway         192.168.8.1
        bridge_ports    eth0
        bridge_fd       9
        bridge_hello    2
        bridge_maxage   12
        bridge_stop     off
But in the new FTTH plan the ONT is without built-in router. I have to reconfigure the Host /etc/network/interfaces

Regards
satimis
 
Old 09-23-2018, 01:34 PM   #9
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,636

Rep: Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965Reputation: 7965
Quote:
Originally Posted by satimis View Post
Sorry. I need to explain in more detail.
In my old FTTH plan the ONT came with a built-in router. Following configure worked without problem

Host
/etc/network/interfaces
Code:
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet manual

# add bridge ports
auto br0
iface br0 inet static
        address         192.168.8.4
        dns-nameservers 218.xxx.xxx.xxx 219.xx.xx.xx
        network         192.168.8.0
        netmask         255.255.255.0
        broadcast       192.168.8.255
        gateway         192.168.8.1
        bridge_ports    eth0
        bridge_fd       9
        bridge_hello    2
        bridge_maxage   12
        bridge_stop     off
But in the new FTTH plan the ONT is without built-in router. I have to reconfigure the Host /etc/network/interfaces
Ok, so **AGAIN**:
  • How, after FIFTEEN YEARS, do you not know the basics of networking??
  • Can you not reference any of the MANY other threads about routing/VM's you've opened, and use what you were told there?
You were plainly told that if you just want your two VM's to know about each other, you simply put them on the same network. That's it. And if the box you're running your VM's on knows about the internet and the rest of the networks, you should be just fine with basic NAT'ing, as described in the Virtualbox documentation..did you read it??

AGAIN, you still aren't being clear about what you're trying to do, and don't seem to be applying anything you've been told over the many years you've been here.
 
  


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
setup home network and file sharing : ubuntu 8.10 , windows xp and wireless router andrekiri Linux - Wireless Networking 2 02-24-2009 07:15 AM
Adding new Linux firewall/router on network with pre-existing gateway/router grittyminder Linux - Networking 4 08-13-2008 02:17 AM
CentoOS router/firewall prob - local network works but router can't access Internet elementalvoid Linux - Networking 6 12-12-2006 03:39 PM
Desktop Sharing thru a Router? mykrob Linux - Networking 1 08-17-2004 12:10 PM
how to get primary logon network, Access control,File sharing & printer sharing info dileepkk Linux - Networking 2 07-06-2004 06:54 AM

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

All times are GMT -5. The time now is 02:04 AM.

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