Configuring manual networking in CentOS




Edit the file at /usr/bin/virtpanel-vm-config and comment out the lines for IPv4 and IPv6 with a # at the start of the lines.



Create the file at /etc/sysconfig/network-scripts/ifcfg-eth0 with the following content (replace x.x.x.x with your server's IPv4 address)

DEVICE=eth0
BOOTPROTO=static
ONBOOT=yes
IPADDR=x.x.x.x
NETMASK=255.255.255.255
IPV6INIT=no
IPV6_AUTOCONF=no




Run the following commands
touch /sbin/ifup-local
chmod +x





Edit the file /sbin/ifup-local and set it to the following contents, replace XXXX with your assigned IPv6 block address

#!/bin/bash
if [[ "$1" != "eth0" ]]; then
  exit
fi

# Setup IPv4 Gateway
ip route add 169.254.1.1 dev eth0
ip route add default via 169.254.1.1

# Setup main IPv6 Address
ip -6 addr add 2a04:2e00:XXXX::/48 dev eth0

# Setup IPv6 Gateway
ip -6 route add default via 2a04:2e00:XXXX::1

# Add additional IPv6 addresses below
ip -6 addr add 2a04:2e00:XXXX:1::2 dev eth0
ip -6 addr add 2a04:2e00:XXXX:1::3 dev eth0





The command systemctl restart network will apply any changes.


Next: VPS » Gateway and Netmask Settings
Previous: VPS » Inject Missing VirtIO Drivers into Windows (INACCESSIBLE_BOOT_DEVICE)