Connecting extra IPs on a server

  • Thread starter jack action
  • Start date
  • Tags
    Server
In summary: LISTEN 0 4096 127.0.0.53%lo:53 0.0.0.0:*
  • #1
jack action
Science Advisor
Insights Author
Gold Member
2023 Award
3,322
8,816
TL;DR Summary
I want to connect extra IPs to the internet on my server
I got a new server that I want to set up. It comes with 2 IPv4 and 1 IPv6. I'm new to these network settings and I have a hard time following what I need to do.

My ISP gives me this info about my IPs (not the real ones):

Code:
IP Address (main)     111.222.11.33
Netmask/Bitmask       255.255.255.0
Gateway               111.222.11.1
Resolver #1           115.225.111.88
Resolver #2           115.225.111.99

IP Address (extra)    111.222.22.44
Netmask/Bitmask       255.255.255.0
Gateway               111.222.22.1
Resolver #1           115.225.111.88
Resolver #2           115.225.111.88

IP Address (internal) 101.202.55.66
Netmask/Bitmask       255.255.0.0
Gateway               101.202.0.1
Resolver #1           N/A
Resolver #2           N/A

Link-local IPv6 Subnet
1234:5678:11:2222::/64

From the ISP dashboard I also created the following IPv6:

Code:
IP Address (created)  1234:5678:11:2222::1
Netmask/Bitmask       48
Gateway               1234:5678:11::1
Resolver #1           N/A
Resolver #2           N/A

I did a first install and I couldn't make either the extra IPv4 or the IPv6 I created reachable from an outside computer. All I ended up achieving was connections on localhost only. Anyway, I ended up screwing everything and now I did a new install. This time I chose to add an extra interface (ens4) during the OS install, setting it up with my extra IPv4, hoping it would at least work with this address. Nope. Works locally but not from an outside computer.

Here is the info from my network:
Code:
username@hostname:~$ ss -lntu
Netid              State               Recv-Q              Send-Q                           Local Address:Port                            Peer Address:Port              Process             
udp                UNCONN              0                   0                                127.0.0.53%lo:53                                   0.0.0.0:*                                     
tcp                LISTEN              0                   4096                             127.0.0.53%lo:53                                   0.0.0.0:*                                     
tcp                LISTEN              0                   128                                    0.0.0.0:22                                   0.0.0.0:*                                     
tcp                LISTEN              0                   128                                       [::]:22                                      [::]:*                                     
username@hostname:~$ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:16:ce:ce:97:8f brd ff:ff:ff:ff:ff:ff
    altname enp0s3
    inet 111.222.11.33/24 brd 111.222.11.255 scope global ens3
       valid_lft forever preferred_lft forever
    inet6 fe80::216:ceff:fece:978f/64 scope link
       valid_lft forever preferred_lft forever
3: ens4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP group default qlen 1000
    link/ether 00:16:e9:e9:cc:67 brd ff:ff:ff:ff:ff:ff
    altname enp0s4
    inet 111.222.22.44/24 brd 111.222.22.255 scope global ens4
       valid_lft forever preferred_lft forever
    inet6 fe80::216:e9ff:fee9:cc67/64 scope link
       valid_lft forever preferred_lft forever
username@hostname:~$ ip r
default via 111.222.22.1 dev ens4 proto static
default via 111.222.11.1 dev ens3 proto static
111.222.22.0/24 dev ens4 proto kernel scope link src 111.222.22.44
111.222.11.0/24 dev ens3 proto kernel scope link src 111.222.11.33

What I did to test the connection was to use n‌c -l4 xxx.xxx.xxx.xxx 8493 to listen to the IPv4 address and open a t‌elnet xxx.xxx.xxx.xxx 8493 on another machine. Even though the ss -lntu command gives the same output for the sockets (only the IP address differs), only the main IP address can communicate outside the localhost.

I must admit I have a hard time following the terms "interface", "address", "route", etc., and what I really need to set up to accomplish what I want. I have no clue what the internal IP address is for and if it is useful to me. I played with netplan and ip and I prefer ip if possible.

Looking for help because not only search engines haven't been really helpful but the server is 3000 miles away and I can't kick it.
 
  • Like
Likes Wrichik Basu
Computer science news on Phys.org
  • #2
I don't understand what you are trying to do.

Considering ipv4 only for the moment, you want one server with one interface card to have two public IP addresses. Why? Pretty much anything you might want to do is more easily accomplished some other way.
 
  • #3
One IP is for a website, the other is for a Tor relay. The Tor relay can optionally (preferably) be connected through an IPv6 as well.
 
  • #4
Caveat: I have limited experience/knowledge on this. It sounds like you want one computer to act like multiple computers when seen from the Internet.

Keep in mind that the DNS (Domain Name Servers) on the Internet go only as far as your service providers connection to you. It is up to you to handle everything past that.

One approach that may work is to have a Router (or possibly just a Switch) connected to the Internet, then the various computer network cards individually connect to the Router with an Ethernet cable. You MAY need a Router for each incoming IP address.

A problem may arise with the network driver software in the computer not being able to handle two network cards. If so, perhaps a copy of the driver software can be loaded for each network card.

Cheers,
Tom

p.s. Interesting situation, please keep us updated!

p.p.s. If you can successfully run two instances of the network software on the computer, you may be able to avoid the two Routers.
 
Last edited:
  • Like
Likes Wrichik Basu
  • #5
Problem solved. My setup was good and the instructions from the web were also good.

The extra IP is DDoS protected and these firewall rules are on the ISP level, above my OS. Basically, everything was blocked except ports 22 and 30120 (which is apparently a port for a FiveM server, a server for the game GTA V multiplayer). This was probably set by the previous owner of the IP. Deleted every rule and now the IP is accessible.

Good thing I couldn't kick the server.
 
  • Informative
  • Like
Likes Wrichik Basu, nsaspook and Tom.G

FAQ: Connecting extra IPs on a server

Can I connect multiple extra IPs on a server?

Yes, you can connect multiple extra IPs on a server. Most servers support the ability to add additional IP addresses to accommodate different services or applications.

How do I connect extra IPs on a server?

To connect extra IPs on a server, you typically need to configure the network settings on the server to recognize and assign the additional IP addresses. This can usually be done through the server's control panel or command line interface.

What are the benefits of connecting extra IPs on a server?

Connecting extra IPs on a server allows you to host multiple websites or services on the same server, each with its own unique IP address. This can improve security, performance, and flexibility for your server setup.

Are there any limitations to connecting extra IPs on a server?

Some hosting providers may have limitations on the number of extra IPs you can connect to a server or may charge additional fees for each extra IP. Additionally, adding extra IPs may require additional configuration and maintenance.

Can I use extra IPs for specific purposes on a server?

Yes, you can use extra IPs for specific purposes on a server. For example, you can assign different IPs to different websites or services on the same server, or use separate IPs for email servers, databases, or other applications that require unique IP addresses.

Back
Top