If you did not configure networking during the CentOS Stream installation, configure it as follows:
To set a static IP address to the server, modify settings as follows. (Replace the interface name [enp1s0] with your own, as it's different on each system.)
Set HostName: If you did not set a hostname, set it as follows:
hostnamectl set-hostname dlp.emc.world
Display Devices:
nmcli device
This command will display something like:
DEVICE TYPE STATE CONNECTION
enp1s0 ethernet connected enp1s0
lo loopback unmanaged --
Set IPv4 Address:
nmcli connection modify enp1s0 ipv4.addresses 10.0.0.30/24
Set Gateway:
nmcli connection modify enp1s0 ipv4.gateway 10.0.0.1
Set DNS:
For multiple DNS, specify with space-separated. Example:
nmcli connection modify enp1s0 ipv4.dns "10.0.0.10 10.0.0.11 10.0.0.12"
Set DNS Search Base:
Set your domain name. For multiple ones, specify with space-separated.
nmcli connection modify enp1s0 ipv4.dns-search emc.world
Set Manual for Static Setting:
nmcli connection modify enp1s0 ipv4.method manual
Restart the Interface to reload settings:
nmcli connection down enp1s0; nmcli connection up enp1s0
Confirm Settings:
nmcli device show enp1s0
Confirm State:
ip address show
To add a static route, use the following command, replacing the values with your specific network settings:
ip route add <destination_network> via <gateway_ip>
For example:
ip route add 192.168.1.0/24 via 10.0.0.1
This command adds a static route for the 192.168.1.0/24 network via the gateway 10.0.0.1.
sysctl (Method 1)To disable IPv6 using sysctl, follow these steps:
Edit the sysctl configuration file:
sudo vim /etc/sysctl.conf
Add the following lines to the end of the file:
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
Save and close the file.
Apply the changes:
sudo sysctl -p
Reboot the system:
sudo reboot
After the system reboots, verify that IPv6 is disabled:
ip address show
grubby (Method 2)To disable IPv6 using grubby, follow these steps:
Disable IPv6:
grubby --update-kernel ALL --args ipv6.disable=1
Verify Kernel Parameters:
grubby --info DEFAULT
Reboot the System:
reboot
Confirm State After Reboot:
ip address show