Where do i find the network-scripts for centOS stream 9? it used to be in ” /etc/sysconfig/network-scripts”
In CentOS Stream 9, the network-scripts package has been discontinued and is no longer preinstalled. The “nmcli” command-line tool for controlling NetworkManager is the suggested method for managing network settings.
Here are a few common examples when managing network settings using “nmcli“:
a) Checking whether NetworkManager is running or not:
[root@localhost ~]# nmcli -t -f RUNNING general
b) Checking overall status of NetworkManager:
[root@localhost ~]# nmcli -t -f STATE general
c) List all network connections:
[root@localhost ~]# nmcli connection show
[root@localhost ~]# nmcli device status
d) Shutdown/Unshut interfaces:
[root@localhost ~]# nmcli dev up ens35
Device ‘ens35’ successfully activated with ‘9b554252-b7a6-4943-9360-d6ec9ff80770’.
[root@localhost ~]# nmcli dev down ens35
Device ‘ens35’ successfully disconnected.
[root@localhost ~]#
e) To delete a route using nmcli, you can use the following command:
# nmcli con modify con_name -ipv4.routes “<route>”
where con_name is the name of the connection you want to modify and <route> is the route you want to remove.
For example, to remove the route “172.16.0.0/12 via 172.26.16.129” from the connection ens33, you can use:
[root@localhost ~]# nmcli con modify ens33-oam -ipv4.routes “172.16.0.0/12 172.26.16.129”
And to remove a default-route, the command is below:
[root@localhost ~]# nmcli con modify ens33-oam -ipv4.routes “0.0.0.0/0 172.26.16.129”