Cannot get public IP

This is for discussing general topics about how to use VirtualBox.
Post Reply
a.maierhofer
Posts: 3
Joined: 19. Sep 2013, 05:54

Cannot get public IP

Post by a.maierhofer »

Hi,

i want to setup some game servers applications for my friends on my dedicated server. One of this applications is running on FreeBSD 8.2 and need to retrieve the public ip. I set up an NAT network adapter for this vm and configured the port forwarding rules.

My problem is that this server application doesn't work if it cannot retrieve the public ip.

Does someone know how to get it working?

I already tried to use a bridged network adapter with a public IP but its not working because it has a different range than the gateway IP like you see in the following example:
Public IP: xxx.xxx.35.xxx
Gateway IP: xxx.xxx.46.xxx
(it should be clear that i don't really enter "xxx" in the settings)

Host-only network adapters don't work as much i know because there are other vm's running at the same time.

Hope for fast and effective help.

Greetings
a.maierhofer
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot get public IP

Post by Perryg »

You would use Bridged and contact your provider to see how to set this up. They have to provide the routing.
a.maierhofer
Posts: 3
Joined: 19. Sep 2013, 05:54

Re: Cannot get public IP

Post by a.maierhofer »

They provide the routing
but the problem is the IP range which i described in my post and this is a problem which they have not to provide.
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Cannot get public IP

Post by Perryg »

Using Bridged is just like having a stand alone PC on the LAN. Now if the provider gave you an public address in a separate range they will need to adjust their route, or tell you how to use it on their circuit. Of course this also depends on your side. If let's say you have a router that uses NAT to separate the public and private addresses you would then need to deal with that yourself. This will have nothing to do with VirtualBox.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Cannot get public IP

Post by noteirak »

A common issue people are facing with dedicated server, here is a list of possible options :

- Since you have a dedicated server and you should have a static IP assigned, why don't you declare the public IP in the game server configuration in the first place?
- You can always create a helper script before starting the game server to get the IP from a helper website and inject that value in the config.

If the game server must see the public IP in the interfaces:
- You can always request an extra IP from your provider (usually called Virtual IP or Failover IP or Secondary IP), set the VM to Bridged, and assign that extra IP to the VM
- There are some obscure techniques to set a loopback address in the VM with the public IP so you can bind on it from the VM.

Be aware that all the networking part is not in scope of Virtualbox at all and will not be supported here.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
a.maierhofer
Posts: 3
Joined: 19. Sep 2013, 05:54

Re: Cannot get public IP

Post by a.maierhofer »

>> Since you have a dedicated server and you should have a static IP assigned, why don't you declare the public IP in the game server configuration in the first place?

The technicians of my provider didn't face such a problem and don't provide a gateway with the same ip range.



>> You can always create a helper script before starting the game server to get the IP from a helper website and inject that value in the config.

I explained the problem in my first post.



>> You can always request an extra IP from your provider (usually called Virtual IP or Failover IP or Secondary IP), set the VM to Bridged, and assign that extra IP to the VM

Explained this in my first post.


>> There are some obscure techniques to set a loopback address in the VM with the public IP so you can bind on it from the VM.

My Provider used this technique.
noteirak
Site Moderator
Posts: 5231
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Cannot get public IP

Post by noteirak »

Let's put aside the fact that your provider is not capable of giving you another dedicated IP, it doesn't stop you from using a script to ask a public website for your own public IP.
You say that you explained in your first post, but I see no mention of a script there...

As for the rest, seems like you got networking mixed up more than anything, but this is way out of scope of this forum.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply