Running Multiple IPs on VPS

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
Post Reply
Puggy04
New to forums
New to forums
Posts: 5
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed Feb 12, 2014 7:54 am

Running Multiple IPs on VPS

Post by Puggy04 »

First off I would like to say sorry if this has already been answered but I have not been able to find any posts that seems to answer this specifically. I rent a 20gb VPS from NFO and have a few game servers running.

What I am trying to accomplish is to a unique IP for each server. I have a 2 Minecraft servers and a Teamspeak voice server. I have read how to change an IP but am not sure how to allow multiple IPs be bound to the server. I have purchased extra IPs, one for each service I am looking to run.

What I want:

TS3 - 111.111.111.11
Minecraft 1 - 222.222.222.22
Minecraft 2 - 333.333.333.33

Hope someone can help; the reason I want to do this is so that I can redirect subdomains to each unique IP as you can DNS to ports! Thanks for the help in advance.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Running Multiple IPs on VPS

Post by soja »

Have you assigned the IPs to the OS? The process for that is detailed here: http://www.nfoservers.com/forums/viewforum.php?f=68

after that, you can change configs for your servers to use each IP.

For minecraft, edit your server.properties and add or change

Code: Select all

server-ip=123.123.123.123
For teamspeak 3, you shouldn't need to change this servers IP as it does not use the same ports as a minecraft server, and each "virtual" teamspeak server can only bind to 1 IP to my knowledge. If you have a NPL for TS3 you run 1 server which can host 10 different TS3 servers. TS3 also supports a special kind of DNS if I recall, called SRV records: http://www.nfoservers.com/forums/viewto ... eamspeak+3

If you need anything else please ask!

EDIT: According to that thread about SRV records, minecraft also supports this, so you might only need 1 IP address if you can get SRV set up!
Not a NFO employee
Puggy04
New to forums
New to forums
Posts: 5
Joined: Wed Feb 12, 2014 7:54 am

Re: Running Multiple IPs on VPS

Post by Puggy04 »

soja wrote:Have you assigned the IPs to the OS? The process for that is detailed here: http://www.nfoservers.com/forums/viewforum.php?f=68

after that, you can change configs for your servers to use each IP.

For minecraft, edit your server.properties and add or change

Code: Select all

server-ip=123.123.123.123
For teamspeak 3, you shouldn't need to change this servers IP as it does not use the same ports as a minecraft server, and each "virtual" teamspeak server can only bind to 1 IP to my knowledge. If you have a NPL for TS3 you run 1 server which can host 10 different TS3 servers. TS3 also supports a special kind of DNS if I recall, called SRV records: http://www.nfoservers.com/forums/viewto ... eamspeak+3

If you need anything else please ask!



EDIT: According to that thread about SRV records, minecraft also supports this, so you might only need 1 IP address if you can get SRV set up!
The reason I wanted one for TS3 was so that I could point each server with its own subdomain redirect to make things easy. Basically Talk.mywebsite.com Vanilla.mywebsite.com and so forth. I do realize I could just run all on the same IP with separate ports; but want to move to this option.

Thanks for pointing me to that post!

EDIT: http://www.nfoservers.com/forums/viewforum.php?f=68 would I just repeat this

Code: Select all

auto eth0:y
iface eth0:y inet static
address your.ip.address
netmask your.netmask
gateway your.gateway
section in the interfaces file? I have used this to set my first IP when I had moved my server location but am unsure how to use this to add additional IPs, sorry I'm still learning Linux and VPS setup.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Running Multiple IPs on VPS

Post by soja »

SRV records are DNS records that include the IP and port. For example you can set vanilla.mywebsite.com to point to 11.11.11.11:25200 and talk.mywebsite.com to 11.11.11.11:25201

It takes a client to support this, and Teamspeak3 and Minecraft do.

Yes, you can repeat that in the config file to my knowledge, remember to have :y a number, I would start from 0 and go up from there.

For example your second section(after your primary IP):

Code: Select all

auto eth0:0
iface eth0:0 inet static
address your.ip.address
netmask your.netmask
gateway your.gateway
Not a NFO employee
Puggy04
New to forums
New to forums
Posts: 5
Joined: Wed Feb 12, 2014 7:54 am

Re: Running Multiple IPs on VPS

Post by Puggy04 »

soja wrote:SRV records are DNS records that include the IP and port. For example you can set vanilla.mywebsite.com to point to 11.11.11.11:25200 and talk.mywebsite.com to 11.11.11.11:25201

It takes a client to support this, and Teamspeak3 and Minecraft do.

Yes, you can repeat that in the config file to my knowledge, remember to have :y a number, I would start from 0 and go up from there.

For example your second section(after your primary IP):

Code: Select all

auto eth0:0
iface eth0:0 inet static
address your.ip.address
netmask your.netmask
gateway your.gateway

I did this

Code: Select all

auto lo
iface lo inet loopback
auto eth0:1
iface eth0:1 inet static
        address 192.223.30.these
        netmask 255.255.255.0
        gateway 192.223.30.these
        dns-nameservers 8.8.8.8 8.8.4.4

auto eth0:2
iface eth0:2 inet static
        address 192.223.30.are 
        netmask 255.255.255.0
        gateway 192.223.30.are
        dns-nameservers 8.8.8.8 8.8.4.4

auto eth0:3
iface eth0:3 inet static
	address 216.52.143.fake
	netmask 255.255.255.0
        gateway 216.52.143.fake
	dns-nameservers 8.8.8.8 8.8.4.4
My Teamspeak runs on the first and I can still connect my MC server cannot bind to the IP I placed in their respective server.properties files.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Running Multiple IPs on VPS

Post by soja »

Did you restart the networking? There is no reason to hide your server IPs here, you give them out publicly to a lot of people every day, and I can help you better if I knew your IP addresses.
Not a NFO employee
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Running Multiple IPs on VPS

Post by soja »

Also note any errors when restarting networking if you see them, and post here.
Not a NFO employee
Puggy04
New to forums
New to forums
Posts: 5
Joined: Wed Feb 12, 2014 7:54 am

Re: Running Multiple IPs on VPS

Post by Puggy04 »

I realize it is not necessary to mask my IPs, I just like to avoid giving them out.

I got this error upon resetting the network

Code: Select all

Since the script you are attempting to invoke has been converted to an
Upstart job, you may also use the stop(8) and then start(8) utilities,
e.g. stop networking ; start networking. The restart(8) utility is also available.
/etc/init.d/networking: 106: /etc/init.d/networking: start: not found
root@themobocracy:~#
here is my full code

Code: Select all

auto lo
iface lo inet loopback
auto eth0:1
iface eth0:1 inet static
        address 192.223.30.127
        netmask 255.255.255.0
        gateway 192.223.30.254
        dns-nameservers 8.8.8.8 8.8.4.4

auto eth0:2
iface eth0:2 inet static
        address 192.223.30.165 
        netmask 255.255.255.0
        gateway 192.223.30.254
        dns-nameservers 8.8.8.8 8.8.4.4

auto eth0:3
iface eth0:3 inet static
	    address 216.52.143.237 
	    netmask 255.255.255.0
        gateway 216.52.143.237
	    dns-nameservers 8.8.8.8 8.8.4.4
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Running Multiple IPs on VPS

Post by soja »

Which version of ubuntu are you using? Try just typing restart networking

EDIT: all of your IP addresses are pingable, meaning they should be operational in the OS. What error is minecraft giving you when trying to bind to an IP?
Not a NFO employee
Puggy04
New to forums
New to forums
Posts: 5
Joined: Wed Feb 12, 2014 7:54 am

Re: Running Multiple IPs on VPS

Post by Puggy04 »

Sorry for the slow response, I went and did some reading and turns out that sudo command fixed it up. I don't know why it required it that time as I have always used the command without it prior to this incident. Thanks for the help I really appreciate the time.
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: Running Multiple IPs on VPS

Post by soja »

ah, glad you got it working!

Yeah system level commands need su access :P

When editing networking or system level stuff logging in as root through vnc or ssh makes it easier.
Not a NFO employee
Post Reply