Private networking allows you to group servers within the same location, enabling private communication between them
Create a VLAN
Assign servers to the VLAN
Load the 8021q module into the kernel and install the VLAN package
Change netplan
/etc/netplan/50-cloud-init.yaml
and add the configuration below to the end of the file.{{VID}}
with the VID value from the VLAN you created.10.8.0.1
with a private address of your choice. This address becomes the private IP of the server within the VLAN. It can be anything you want, but each server in the same VLAN needs a different IP.eno2
with the correct interface name. For servers with bonded interfaces, use bond0.vlans
section should be at the same indentation level of the ethernet
key.Adding a default route
10.8.0.0/16
with the network prefix you want to reach through eno2.
192.168.0.1
with the gateway IP address for your network (typically the first IP of your subnet).
Save the file and apply the configuration
Setting up 802.1Q VLAN tagging using IFCFG files
Configure the parent interface
/etc/sysconfig/network-scripts/ifcfg-eno2
.Set the VLAN interface configuration
/etc/sysconfig/network-scripts/ directory
. The configuration file name should be the parent interface plus a .
character followed by the VLAN ID number. For example, if the VLAN ID is 192, and the parent interface is eth0, then the configuration file name should be ifcfg-eno2.192
:Set up the second VLAN
eno2.193
with the VLAN configuration details. Restart the networking service in order for the changes to take effect. As root
issue the following command: