Back to articles
Security & Anti-DDoS

Advanced Network Configuration on VPS with IPv6, Private Network, and Internal Link Security

A detailed guide to configuring advanced networking on VPS using IPv6, private network, and internal link security to enhance infrastructure safety.

DPTCloud Engineering4 min read
Advanced Network Configuration on VPS with IPv6, Private Network, and Internal Link Security

Advanced Network Configuration on VPS with IPv6 and Private Network

In modern cloud environments, configuring advanced networking on VPS not only optimizes performance but also enhances security, especially when using IPv6 and private network. This guide provides a step-by-step configuration of secure internal networking on VPS at DPTCloud, including IPv6 setup, private network connection, and internal link security measures.

Prerequisites

  • VPS deployed at DPTCloud with IPv6 and private network support.
  • SSH account with root or sudo privileges.
  • Private network enabled on the VPS (via DPTCloud control panel).
  • Known IPv6 and private network IP addresses of the VPS.

1. Configure IPv6 on VPS

IPv6 expands address space and improves security by limiting common port scanning techniques. On VPS, IPv6 configuration involves editing the network configuration file.

1.1. Check IPv6 Connectivity

Run the following command to verify IPv6 support:

ip -6 addr show

If an IPv6 address appears (e.g., 2001:db8::1/64), IPv6 is enabled.

1.2. Permanent IPv6 Configuration

Edit the network configuration file:

sudo nano /etc/netplan/01-network-manager-all.yaml

Add the following IPv6 configuration:

network:
  version: 2
  renderer: networkd
  ethernets:
    eth0:
      addresses:
        - 2001:db8::1/64
      gateway6: 2001:db8::1
      nameservers:
        addresses:
          - 2001:4860:4860::8888
          - 2001:4860:4860::8844

Apply the configuration:

sudo netplan apply

2. Connect to Private Network

Private network is an isolated internal network that protects data between VPS instances within the same data center.

2.1. Enable Private Network

In the DPTCloud control panel, select the VPS and enable the Private Network option. The VPS will receive an internal IP address (e.g., 10.0.0.1).

2.2. Configure Private Network on VPS

Edit the network configuration file:

sudo nano /etc/netplan/01-network-manager-all.yaml

Add the following configuration:

network:
  version: 2
  renderer: networkd
  ethernets:
    eth1:
      addresses:
        - 10.0.0.1/24
      gateway4: 10.0.0.254

Apply the configuration:

sudo netplan apply

To protect connections between VPS instances in the private network, implement the following measures:

3.1. Configure Firewall with UFW

Allow connections only from the private network:

sudo ufw allow from 10.0.0.0/24
sudo ufw allow proto tcp to 10.0.0.1 port 22
sudo ufw enable

3.2. Use SSH Key-Based Authentication

Disable password login and use SSH keys only:

ssh-keygen -t ed25519
ssh-copy-id [email protected]

3.3. Configure IPsec or WireGuard

To encrypt internal connections, use WireGuard:

sudo apt install wireguard
sudo wg genkey | sudo tee /etc/wireguard/privatekey | sudo wg pubkey | sudo tee /etc/wireguard/publickey

Create the configuration file /etc/wireguard/wg0.conf:

[Interface]
PrivateKey = 
Address = 10.0.0.2/24
ListenPort = 51820

[Peer]
PublicKey = 
Endpoint = 10.0.0.1:51820
AllowedIPs = 10.0.0.1/32

4. Verify and Test

  • Run ping 10.0.0.1 from one VPS to another in the private network.
  • Use ss -tuln to check that SSH and WireGuard ports are listening.
  • Test SSH connection from one VPS to another using the private IP.

5. Troubleshooting

  • Cannot connect to private network: Verify the netplan configuration and ensure the private network is enabled in the control panel.
  • IPv6 not working: Check the IPv6 gateway and router settings, and confirm the VPS is assigned an IPv6 address.
  • SSH connection denied: Review UFW rules to ensure access is allowed from the private network.

References

Configuring advanced networking on VPS with IPv6 and private network enhances internal security, particularly suitable for systems requiring high privacy such as API infrastructures, internal servers, or DevOps environments.

DPTCloud Tier III Infrastructure

Recommended NVMe Cloud VPS Plans to Deploy This Setup

Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.

View 22 VPS Plans
ECO · vn-02

VPS-2E

94.600 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 2 GB
  • SSD: 30 GB NVMe
ECO · vn-02Recommended

VPS-3E

170.500 ₫ / mo

10% VAT included

  • CPU: 2 vCPU
  • RAM: 4 GB
  • SSD: 50 GB NVMe
BASIC · vn-01Recommended

VPS-05

457.600 ₫ / mo

10% VAT included

  • CPU: 4 vCPU
  • RAM: 8 GB
  • SSD: 50 GB NVMe

Related Articles

View all
ZaloZalo SupportDiscord0384 753 478