Hello all.
I'm trying to setup virtualbox on Hetzner Dedicated Machine.
I have the below Setup:
Host:
OS -> CentOS 7
Static IP Address (ex 10.10.10.100)
Gateway (ex 10.10.10.1)
1 adapter (enp0s6)
Guest
OS -> CentOS 7
Static IP Address (ex 10.10.20.11)
Gateway -> Host Address (ex 10.10.10.100)
1 adapter (enp0s3) bridged to host (enp0s6)
The problem is that i can reach Internet from VM (I have also turn off NetworkManager Service).
*** Please note. The problem occurs with Hetzner Subnet IPs.
At the past when i was bought single IPs they give me "Seperate MAC Address". When i was added that mac on VM adapter the networks played well. No problem. Also the gateway it was different from the host.
Now with subnet i have problem with the same setup.
The told me that i must to do routing from the Host system.
On KVM i was found many solutions but no with VirtualBox. What changes i must to do to make that route? What adapter i must to choose?
Thank you.
Problem Reach Internet VM on Linux Host (Hetzner)
-
socratis
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Problem Reach Internet VM on Linux Host (Hetzner)
If you use Bridged mode, then your guest's IP shouldn't be 10.10.20.x, but 10.10.10.x., you're not in the same range, that's what Bridged means. Alternatively, use DHCP for your guest. Why do you want a static IP?largko wrote:Static IP Address (ex 10.10.20.11)
Gateway -> Host Address (ex 10.10.10.100)
1 adapter (enp0s3) bridged to host (enp0s6)
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Re: Problem Reach Internet VM on Linux Host (Hetzner)
Hello,
As i explained before the setup is on Dedicated machine on Hetzner.
Machine has a single static IP from Hetzner and i have buy an external /26 ipv4 subnet.
The subnet has different range from main ip.
When i ask Hetzner about the subnet and VM's their answer it was:
I have found many solutions for KVM but nothing for VirtualBox. (KVM Solutions, both of google and Hetzner does not working with Virtualbox).
I think the solution is somewhere between a new bridge on host or a host only network.
I'm one step closer to use KVM instead VirtualBox to do my job, but i prefer VirtualBox.
Thank you.
As i explained before the setup is on Dedicated machine on Hetzner.
Machine has a single static IP from Hetzner and i have buy an external /26 ipv4 subnet.
The subnet has different range from main ip.
When i ask Hetzner about the subnet and VM's their answer it was:
As i understand i can't use (maybe) the bridge solution on VirtualBox? But my problem is how i will make the routing."The subnet is routed to the main IP of your server. You need to set u a routed network configuration in order to distribute the IPs to your VMs. Virtual MACs are not available for subnets."
I have found many solutions for KVM but nothing for VirtualBox. (KVM Solutions, both of google and Hetzner does not working with Virtualbox).
I think the solution is somewhere between a new bridge on host or a host only network.
I'm one step closer to use KVM instead VirtualBox to do my job, but i prefer VirtualBox.
Thank you.
-
socratis
- Site Moderator
- Posts: 27329
- Joined: 22. Oct 2010, 11:03
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Win(*>98), Linux*, OSX>10.5
- Location: Greece
Re: Problem Reach Internet VM on Linux Host (Hetzner)
If you simply want your VM to have access to the Internet, then change it to "NAT" from "Bridged" and change the VM to get a DHCP address, not a static one. Make sure that you reset all the Gateway/Mask/other info from the TCP/IP configuration of the guest that you entered manually...
For more information see ch. 6.2. Introduction to networking modes including the Overview table, which shows quickly what kind of connection is required to achieve what you want. And remember, you can always have more than one network card in your guest to cover multiple scenarios.
PS. Not everybody knows what "Hetzner" is, you might want to explain it next time...
For more information see ch. 6.2. Introduction to networking modes including the Overview table, which shows quickly what kind of connection is required to achieve what you want. And remember, you can always have more than one network card in your guest to cover multiple scenarios.
PS. Not everybody knows what "Hetzner" is, you might want to explain it next time...
Do NOT send me Personal Messages (PMs) for troubleshooting, they are simply deleted.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Do NOT reply with the "QUOTE" button, please use the "POST REPLY", at the bottom of the form.
If you obfuscate any information requested, I will obfuscate my response. These are virtual UUIDs, not real ones.
Re: Problem Reach Internet VM on Linux Host (Hetzner)
Thank you for your try but i can't use DHCP.
HETZNER is Data Center at Germany. They sell Dedicated Server or Cloud Services.
I'm not just install the VirtualBox to my home pc.
The HOST is a dual XEON 16 Core CPU / 256GB RAM / 1TBx2 NVMe / 10Gbit Network. (And we have many of that HOSTS/machines)
I will install many VPS on this (and others) machine for several reasons/services.
And now i hope understand at this solution we can't speak about DHCP solutions. All are static. Everything.
Also the static IPs provided from Hetzner, they are Public V4 IPs (Like ISP, ex check your home router external ip) and i can't choose to my self.
NAT Solution is not solution, because every machine must be on public with each static ip. NAT is a solution that any VPS will be behind host and if you want any service you must make port forward.
HETZNER is Data Center at Germany. They sell Dedicated Server or Cloud Services.
I'm not just install the VirtualBox to my home pc.
The HOST is a dual XEON 16 Core CPU / 256GB RAM / 1TBx2 NVMe / 10Gbit Network. (And we have many of that HOSTS/machines)
I will install many VPS on this (and others) machine for several reasons/services.
And now i hope understand at this solution we can't speak about DHCP solutions. All are static. Everything.
Also the static IPs provided from Hetzner, they are Public V4 IPs (Like ISP, ex check your home router external ip) and i can't choose to my self.
NAT Solution is not solution, because every machine must be on public with each static ip. NAT is a solution that any VPS will be behind host and if you want any service you must make port forward.
-
fth0
- Volunteer
- Posts: 5690
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Problem Reach Internet VM on Linux Host (Hetzner)
This statement can be right and wrong at the same time: It is most likely correct regarding the network provided to your host by Hetzner. But you can have additional networks between your host and your guest, and on these networks nobody will prevent you from using DHCP. socratis gave you the link to the relevant chapter of the VirtualBox User Manual, where you can expand your knowledge about combining two or more networks (e.g. guest - host, host - Hetzner, Hetzner - Internet).largko wrote:Thank you for your try but i can't use DHCP.
After reading the whole thread so far, I still do not know what you exactly want to achieve, and what exactly Hetzner provides to you. For example, you are giving IPv4 addresses without IPv4 netmasks/prefixes, and IPv4 addresses without netmasks/prefixes are mostly meaningless in networking. Please tell us which devices will exist in the final setup (e.g. host, guest, PC in your company or home or at a customer), which kind of network connections between those devices are needed, what purposes you want to achieve. Try to be as exact as possible.
PS: You can also write your text in your native language first and then use the DeepL translator (better than Google and Microsoft Translate) to translate it to the English language. This could prevent misunderstandings.
Re: Problem Reach Internet VM on Linux Host (Hetzner)
Hello again.
I'll try to explain better.
I have a Host Machine with IP: 10.10.10.100/32 with Gateway 10.10.10.1
Also i have IP Subnet: 10.10.20.128/26, that means 10.10.20.129-191 (64 IPs for use).
I want to setup a VirtualBox VM with IP 10.10.20.129/26 and the VPS can reach the internet. Please note i don't wan to USE port forward (NAT).
I want All traffic from IN/OUT of 10.10.20.129 somehow to routed from Host Machine (10.10.10.100).
Which adapter i must to use? It must to make some routes to hosts?
That i'm looking for.
Thank you.
I'll try to explain better.
I have a Host Machine with IP: 10.10.10.100/32 with Gateway 10.10.10.1
Also i have IP Subnet: 10.10.20.128/26, that means 10.10.20.129-191 (64 IPs for use).
I want to setup a VirtualBox VM with IP 10.10.20.129/26 and the VPS can reach the internet. Please note i don't wan to USE port forward (NAT).
I want All traffic from IN/OUT of 10.10.20.129 somehow to routed from Host Machine (10.10.10.100).
Which adapter i must to use? It must to make some routes to hosts?
That i'm looking for.
Thank you.
-
fth0
- Volunteer
- Posts: 5690
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Problem Reach Internet VM on Linux Host (Hetzner)
You should follow the instructions in the Hetzner DokuWiki in https://wiki.hetzner.de/index.php/Zusae ... P-Adressen (German) or https://wiki.hetzner.de/index.php/Zusae ... dressen/en (English) (note that there is also a subpage for CentOS at the bottom to fill in the missing details):
Use the 'routed method', where you configure your host to route between its physical network interface (eth0) and a bridge (br0) or tap (tap0) interface you create on your host. Configure VirtualBox to use a Bridged Adapter (connected to br0 or tap0).
Alternatively, you can use a Host-only Adapter (vboxnet0) in VirtualBox, if you like to use the VirtualBox DHCP server to manage your subnet addresses. In this case, you have to route between eth0 and vboxnet0 on your host.
Use the 'routed method', where you configure your host to route between its physical network interface (eth0) and a bridge (br0) or tap (tap0) interface you create on your host. Configure VirtualBox to use a Bridged Adapter (connected to br0 or tap0).
Alternatively, you can use a Host-only Adapter (vboxnet0) in VirtualBox, if you like to use the VirtualBox DHCP server to manage your subnet addresses. In this case, you have to route between eth0 and vboxnet0 on your host.
Re: Problem Reach Internet VM on Linux Host (Hetzner)
Hello fth0,
you are close enough that i want.
You show me an article on Hetzner and i found the image that i'm trying to explain.

I was made the br0 or vboxnet0 but without success.
The only part that i'm stuck is the "routing" between (br0/vboxnet0) with the main adapter (eth0) on CentOS.
Also i was read that point:
https://www.mylinuxplace.com/create-tap ... -centos-7/
The only part is the routing between tap0 <--> eth0
Thanks!
you are close enough that i want.
You show me an article on Hetzner and i found the image that i'm trying to explain.

I was made the br0 or vboxnet0 but without success.
The only part that i'm stuck is the "routing" between (br0/vboxnet0) with the main adapter (eth0) on CentOS.
Also i was read that point:
And i found that:VirtualBox: Guests are tied to an existing TAP interface and thus form a segment per TAP device. Create TAP interfaces according to your distribution. In the settings dialog of a single machine, select for assignment: Network > Attached to: "Bridged Adapter". Name: "tap0".
https://www.mylinuxplace.com/create-tap ... -centos-7/
The only part is the routing between tap0 <--> eth0
Thanks!
-
fth0
- Volunteer
- Posts: 5690
- Joined: 14. Feb 2019, 03:06
- Primary OS: Mac OS X other
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Linux, Windows 10, ...
- Location: Germany
Re: Problem Reach Internet VM on Linux Host (Hetzner)
Did you also read and follow the CentOS subpage I've been referring to?
I'm no expert on CentOS, so maybe I cannot help you with your CentOS setup. But let's try the following: Post the output of 'ifconfig -a', 'route -n', 'ip addr show' and 'ip route show', all on your host (at least one pair of those commands should exist).
I'm no expert on CentOS, so maybe I cannot help you with your CentOS setup. But let's try the following: Post the output of 'ifconfig -a', 'route -n', 'ip addr show' and 'ip route show', all on your host (at least one pair of those commands should exist).