Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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?
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??
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
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.