Introduction
A basic community configuration at ONENETS includes a single ipv4, configured by using DHCP. when you have excellent networking requirements, ONENETS helps more than one public IPS and up to 5 private networks. you want to manually configure these advanced situations. Refer to the networking configuration web page within the client portal for your specific configuration. This example demonstrates three public ipv4 addresses, two personal ipv4 networks, and two public ipv6 addresses.
Example for CentOS 8
Public Network
-
Define three public IPv4 addresses and two public IPv6 addresses on adapter ens3.
Populate/etc/sysconfig/network-scripts/ifcfg-ens3
with:TYPE="Ethernet" DEVICE="ens3" ONBOOT="yes" BOOTPROTO="none" IPADDR=192.0.2.101 PREFIX=23 GATEWAY=192.0.2.1 DNS1=192.0.2.200 IPADDR1=192.0.2.102 PREFIX1=32 IPADDR2=192.0.2.103 PREFIX2=32 IPV6INIT="yes" IPV6_AUTOCONF="yes" IPV6ADDR_SECONDARIES="2001:db8:1000::100 2001:db8:1000::200"
-
Restart the connection or reboot.
# nmcli con load /etc/sysconfig/network-scripts/ifcfg-ens3 # nmcli con up 'System ens3'
Private Network
-
Define the first private network on adapter ens7.
Populate/etc/sysconfig/network-scripts/ifcfg-ens7
with:TYPE="Ethernet" DEVICE="ens7" ONBOOT="yes" BOOTPROTO="none" IPADDR=10.1.1.100 PREFIX=20 MTU=1450
-
Restart the connection or reboot.
# nmcli con load /etc/sysconfig/network-scripts/ifcfg-ens7 # nmcli con up 'System ens7'
-
Define the second private network on adapter ens8.
Populate/etc/sysconfig/network-scripts/ifcfg-ens8
with:TYPE="Ethernet" DEVICE="ens8" ONBOOT="yes" BOOTPROTO="none" IPADDR=10.1.1.200 PREFIX=20 MTU=1450
-
Restart the connection or reboot.
# nmcli con load /etc/sysconfig/network-scripts/ifcfg-ens8 # nmcli con up 'System ens8'
Example for CentOS 6 and 7
Public Network
Configure the public network with three public IPv4 addresses and two public IPv6 addresses.
-
Define the first public IPv4 and both public IPv6 addresses on adapter eth0.
Populate/etc/sysconfig/network-scripts/ifcfg-eth0
with:DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.0.2.101 NETMASK=255.255.254.0 GATEWAY=192.0.2.1 DNS1=192.0.2.200 IPV6INIT=yes IPV6ADDR="2001:db8:1000::100/64" IPV6_AUTOCONF="yes" IPV6ADDR_SECONDARIES="2001:db8:1000::200/64" DNS2=2001:db8:1000::1
-
Set the default route for eth0.
Populate/etc/sysconfig/network-scripts/route-eth0
with:169.254.0.0/16 dev eth0
-
Define the second public IPv4 on adapter eth0:1.
Populate/etc/sysconfig/network-scripts/ifcfg-eth0:1
with:DEVICE=eth0:1 BOOTPROTO=static IPADDR=192.0.2.102 NETMASK=255.255.255.255 ONBOOT=yes
-
Define the third public IPv4 on adapter eth0:2.
Populate/etc/sysconfig/network-scripts/ifcfg-eth0:2
with:DEVICE=eth0:2 BOOTPROTO=static IPADDR=192.0.2.103 NETMASK=255.255.255.255 ONBOOT=yes
Private Network
-
Define the first private network on adapter eth1.
Populate/etc/sysconfig/network-scripts/ifcfg-eth1
with:DEVICE=eth1 ONBOOT=yes BOOTPROTO=static IPADDR=10.1.1.100 NETMASK=255.255.240.0 MTU=1450
-
Define the second private network on adapter eth2.
Populate/etc/sysconfig/network-scripts/ifcfg-eth2
with:DEVICE=eth2 ONBOOT=yes BOOTPROTO=static IPADDR=10.1.1.200 NETMASK=255.255.240.0 MTU=1450
Activate Network Changes
Restart networking or reboot to activate the network changes.
# service network restart
Note: If you have IP forwarding enabled (using your server as a VPN or similar), you will also need to add the following lines to /etc/sysctl.conf
file. The default settings for these variables (which is 1), prevents IPv6 from working properly when IP forwarding is enabled. You can check if IP forwarding is enabled by running sysctl net.ipv4.ip_forward
.
net.ipv6.conf.all.accept_ra=2
net.ipv6.conf.eth0.accept_ra=2
Nameservers
Verify that /etc/resolv.conf has your preferred nameservers for IPv4, and optionally IPv6.
domain example.com
nameserver 2001:db8:1000::1
nameserver 192.0.2.200