How to Configure a Private Network on Debian
source link: https://www.vultr.com/docs/how-to-configure-a-private-network-on-debian
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Using a Different System?
- Configure CentOS with Multiple IP Addresses
- Configure Fedora with Multiple IP Addresses
- Configure Debian with Multiple IP Addresses
- Configure Ubuntu with Multiple IP Addresses
- Configure FreeBSD with Multiple IP Addresses
- Configure OpenBSD with Multiple IP Addresses
- Configure Windows with Multiple IP Addresses via PowerShell
- Configure Windows with Multiple IP Addresses via GUI
- How to Configure a Private Network on CentOS
- How to Configure a Private Network on Fedora
- How to Configure a Private Network on Fedora CoreOS
- How to Configure a Private Network on FreeBSD
- How to Configure a Private Network on OpenBSD
- How to Configure a Private Network on Ubuntu
- How to Configure a Private Network on Windows Server
- How to Configure a Private Network on VzLinux
- How to Configure a Private Network on AlmaLinux
- How to Configure a Private Network on Rocky Linux
- Configure AlmaLinux with Multiple IP Addresses
- Configure Rocky Linux with Multiple IP Addresses
- Configure VzLinux with Multiple IP Addresses
Introduction
Vultr provides many flexible networking options for your cloud servers. In addition to the public network attached to every Vultr instance, you can configure up to five private networks per location. Private networks allow instances within a location to communicate without exposing the traffic to the public internet.
Note: Your network adapter names may not match the examples. See our article How to Find the Network Adapter Names for a Vultr Cloud Server.
Please see the guide How to Configure a Private Network at Vultr for general information about Vultr's private network feature.
Private networks do not have DHCP. When deploying a Vultr cloud server with private networking, you must manually configure the private adapters or supply your own DHCP server. We provide network configuration examples for many popular operating systems, pre-configured for your instance's IP addresses. You can find these by navigating to the settings screen (1)
for your server, then selecting IPv4 (2)
. Follow the networking configuration link (3)
to view the configuration examples.
The configurations in the customer portal are your best source of specific information. Please see below for step-by-step instructions with generic examples.
Debian 7, Debian 8
Verify that private networking is enabled for your cloud server. Your private network device is eth1. Your public network device is eth0.
Add the following text to the /etc/network/interfaces
file. Replace 10.10.10.3 with your IP address.
auto eth1
iface eth1 inet static
address 10.10.10.3
netmask 255.255.0.0
mtu 1450
Start the interface or reboot.
# ifup eth1
Debian 9, Debian 10
Verify that private networking is enabled for your cloud server. Your private network device is ens7. Your public network device is ens3.
Add the following text to the /etc/network/interfaces
file. Replace 10.10.10.3 with your IP address.
auto ens7
iface ens7 inet static
address 10.10.10.3
netmask 255.255.0.0
mtu 1450
Start the interface or reboot.
# ifup ens7
Optional: Use systemd-networkd
If you prefer to use systemd-networkd
configuration instead of the default Debian networking
configuration, follow these steps.
Move the existing interfaces file to disable it.
# mv /etc/network/interfaces /etc/network/interfaces.save
Edit the
public.network
configuration.# nano /etc/systemd/network/public.network
Add the following text.
Use ens3 for Name on Debian 9 and 10.
Use eth0 for Name on Debian 7 and 8.[Match] Name=ens3 [Network] DHCP=yes
Save and exit the file.
Edit the
private.network
configuration.# nano /etc/systemd/network/private.network
Add the following text.
Replace 10.10.10.3 with your IP address.
Use ens7 for Name on Debian 9 and 10.
Use eth1 for Name on Debian 7 and 8.[Match] Name=ens7 [Link] MTUBytes=1450 [Network] Address=10.10.10.3/20
Save and exit the file.
Enable the new network services.
# systemctl enable systemd-networkd # systemctl enable systemd-resolved
Start the new network services.
# systemctl start systemd-networkd # systemctl start systemd-resolved
Disable the old network configuration.
# systemctl disable networking
If the network fails to load, use the Vultr Web Console to make corrections. In rare cases, a reboot may be required.
Manage Private Networks via API
The Vultr API offers several endpoints to manage private networks.
Want to contribute?
You could earn up to $600 by adding new articles
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK