How To Create A Private Network Inside Your Instance
On the F2H network, a private network can be very useful for server administrators. Private networks allow you to communicate with servers over an internal network. This network is not connected to the outside world and is perfect to store things like databases. For example, you could install a remote MySQL server with an isolated network and connect that to a production server over the internal network. This would be 100% secure because no one from outside the private network could reach your MySQL server. It’s also possible to connect instances in one DC to another instance in a different DC. Private networking is available on LXC based instances now and will be compatible with KVM in the future.
Create Private Network
Note: We may automatically assign a private IP. So, if a private IP is already assigned the “+ Create Private Network” button does not appear. To create your private network;
- Access your Products & Services and select the instance you want to create a private network for.
- In the instance menu bar to the left, select “Network“.
- On the network management page, select “+Create Private Network“.
- Click to confirm and create the network.
The network will assign you a private IP which can be configured inside your instance.
Configure A Private Network Inside An Instance
Now that your private network is assigned, in the example above the network assigned us 10.10.10.2 you need to configure it inside your instance. This process is different depending on what distribution your instance is running. Access your instance via SSH or by using the NoVNC console option and choose your OS distribution;
CentOS 7, CentOS 8
cd /etc/sysconfig/network-scripts && ls && cat ifcfg-eth0
In the file list you will notice the file ifcfg-eth0, we have listed the contents of this file. Notice we assign instance IPs using DHCP. For this reason, do not add your private network settings to this file. instead, create a new interface attached to eth0. In our example, we are using eth1 and eth0. and we advise you do the same so any additional IPs do not get mixed up. use ifup eth1 to bring up the new interface
nano /etc/sysconfig/network-scripts/ifcfg-eth1 NM_CONTROLLED="no" DEVICE=eth1 BOOTPRONTO=static ONBOOT=yes IPADDR=10.10.10.2 GATEWAY=10.10.10.1 NETMASK=255.255.255.0
nano /etc/network/interfaces auto eth0 iface eth0 inet static address 10.10.10.2/27 gateway 10.10.10.1
So, now you have a production server and a private server and If you are installing MySQL to your private server to store a database you can use your private IP to connect to your MySQL server. Some instance distributions require you to allow login via SSH
How was this article?
You might also like
More from Instance Management
How To Expand A Logical Volume After Attaching Further Space
If you have installed your Discovery instance using a distribution ISO. Then it's likely your drive will be using a …
How To Configure An Internal MySQL Database Server
How To Configure An Internal MySQL Database Server High-value assets like database servers are always a target for hackers. Typically, these …
How To Hotplug Resources To Meet Spikes In Demand
How To Hotplug Resources To Meet Spikes In Demand These days it's important that your network is online as much as …