Page 1 of 1
Cannot get public IP
Posted: 19. Sep 2013, 06:16
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
Re: Cannot get public IP
Posted: 19. Sep 2013, 15:21
by Perryg
You would use Bridged and contact your provider to see how to set this up. They have to provide the routing.
Re: Cannot get public IP
Posted: 19. Sep 2013, 21:36
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.
Re: Cannot get public IP
Posted: 19. Sep 2013, 21:48
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.
Re: Cannot get public IP
Posted: 21. Sep 2013, 12:42
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.
Re: Cannot get public IP
Posted: 23. Sep 2013, 00:38
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.
Re: Cannot get public IP
Posted: 23. Sep 2013, 01:10
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.