Question
How can I configure a server network on a single network interface for use the server in my cloud.net cloud?
Environment
Cloud.net, all versions.
Answer
It's required to have at least two separate networks for the compute resources that are Management and Appliance. If there has no possibility to go with VLAN configuration to separate these networks then as an alternative please follow the instruction below that will help you to configure Virtual Ethernet devices:
Prepare your servers before adding them to your cloud.net cloud:
Server:
- SSH to your server
- Install dependencies
#yum install wget bridge-utils net-tools arptables -y
3. Download the network configuration script
#wget https://raw.githubusercontent.com/OnApp/veth/main/veth.sh -O onapp-cfg-net.sh
4. Run the script
#bash onapp-cfg-net.sh
The script backups the original interface configuration to /etc/sysconfig/network-scripts/ifcfg-<eth>.orig that allows to revert the changes. |
In addition, you will be offered to configure the backup/provisioning network. Assuming that Compute Resources and Backup Servers are attached to the same physical Network/VLAN(L2).
For example, you have added 192.168.0.11/24 to this compute resource and 192.168.0.1/24 to the backup server during its configuring. Then the following aliases will be created "onappBridge:1" and these IPs assigned to them.
5. If you’ve configured the backup/provisioning network on the previous step then after successful deployment you need to connect to the compute resource/backup servers via SSH and run the configuration script with the following options:
On compute resource
# /onapp/onapp-hv-install/onapp-hv-config.sh -b <backup_ip_address>
On backup server
# /onapp/onapp-bk-install/onapp-bk-config.sh -b <backup_ip_address>
Replace <backup_ip_address> with the backup IP you’ve specified in step 4
In this case, you need to have the same network scheme to be configured on both the compute resource and the backup server. |
6. Reboot the server and check the network settings have been configured properly
Just a few commands for a simple check:
#ip -o link
#ip -o addr
#brctl show
#ping -c1 <neighbor_backup_ip_address>
You should see:
Bridge "onappBridge" and its members "eth0" and "ethManagement"
Virtual Ethernet devices "ethManagement" "ethAppliance"
Backup IP on the alias interface "onappBridge:1"
CR and BS should be able to ping each other over the provisioning/backup network
How to revert the changes
1. Remove the network configuration files created by the script
rm -f /etc/sysconfig/network-scripts/ifcfg-eth{Appliance,Management}
rm -f /etc/sysconfig/network-scripts/ifcfg-onapp*
rm -f /etc/cron.d/PrepareOnappNetwork
2. Restore the original configuration
# mv /etc/sysconfig/network-scripts/ifcfg-<eth>{.orig,}
Replace <eth> with the real name of the physical interface, eth0 for example
3. Reboot the server or run
# service network restart
Some of the Appliance network configurations that should work with the configuration above:
Scenario 1: I have got a separate network from the management one.
This is the default scenario where the default gateway of this appliance network is located in the same broadcast domain (layer 2) as the public (ethX) interface. No additional configurations are required on the compute resources. Go to the Network configuration page and create a new network, IP net, IP ranges.
Scenario 2: I would like to use an IP range of the management network for Appliance purposes the server public IP belongs to.
Create a network, IP net, IP range excluding the server public IP from this range. No additional configurations are required on the compute resources.
Example:
The network is 144.217.66.80/28, HostMin 144.217.66.81, HostMax 144.217.66.94, Hosts 14
The public IP of the server is 144.217.66.81, the default gateway is 144.217.66.94
Then Network configuration in my cloud.net Control Panel could be:
IP net: 144.217.66.80/28, gw 144.217.66.94
IP range: 144.217.66.82-144.217.66.93, gw 192.168.0.94.
Scenario 3: soyoustart.com
I have a network (IP subnet) that is routed to the public IP address of the server which I would like to use as an Appliance network.
Create an alias interface to onappBridge and add, for example, the HostMin IP of this subnet to this alias interface. This IP address will act as a default gateway for this network.
Example:
Public server IP 144.217.66.129
App Network: 51.222.175.92/30, HostMin 51.222.175.93, HostMax 51.222.175.94, Hosts 2
# cat << EOF > /etc/sysconfig/network-scripts/ifcfg-onappBridge:2
DEVICE=onappBridge:2
ONBOOT=yes
NM_CONTROLLED=no
IPADDR=51.222.175.93
NETMASK=255.255.255.252
EOF
#ifup onappBridge:2
The alias with index one is reserved for the backup/provisioning network interface.
Then Network configuration in my cloud.net Control Panel could be:
IP net: 51.222.175.92/30, gw 51.222.175.93
IP range: 51.222.175.94-51.222.175.94, gw 51.222.175.93.
Now it's time to add those prepared servers to the Control Panel through the Infrastructure Wizard.
On the "Configure appliance network" page of the wizard select the "ethAppliance" interface from the dropdown menu that is connected to the appliance network.
We would recommend building a new virtual server on this compute resource to check everything works as expected.
If you plan to add this compute resource to one of the existing compute zones.
Cloud.net Control Panel:
- Add a compute resource to the cloud.
- Attach this compute resource to a compute zone.
- Create a new network and add IP nets, IP range.
Based on the provided examples it could look like this:"network_address": "51.222.175.80","default_gateway": "51.222.175.81","network_mask": 28
"start_address": "51.222.175.82","end_address": "51.222.175.94", "default_gateway": "51.222.175.81" - Add this network to one of the existing network zones or create a new one.
- Add network join to the compute resource. Where the Interface Name is a virtual appliance interface that was created by the script. (ethAppliance by default).
- If you’ve configured the backup/provisioning network then set appropriate backup IP addresses for the compute resources and backup server.
Comments
0 comments
Please sign in to leave a comment.