IP Configuration in RHEL 9
Md. Habibur Rahman
Oracle DBA, System & Network Administrator | B.Sc in CSE | Vendor: RHCE EX294V9K; RHCSA EX200V9K; CCNA 200-301; MTCRE; MTCNA | Courses: CKA, CKAD
[root@workstation ~]# nmcli connection add con-name nat_IP ifname enp1s0 type ethernet ipv4.addresses 192.168.122.59/24 ipv4.gateway 192.168.122.1 ipv4.dns 8.8.8.8 ipv4.method manual autoconnect yes
[root@workstation ~]# nmcli connection up nat_IP
[root@workstation ~]# systemctl restart NetworkManager
[root@workstation ~]# ifconfig?
enp1s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>?mtu 1500
????inet 192.168.122.59?netmask 255.255.255.0?broadcast 192.168.122.255
????inet6 fe80::a200:aa9e:5f86:8a9f?prefixlen 64?scopeid 0x20<link>
????ether 52:54:00:a2:82:98?txqueuelen 1000?(Ethernet)
????RX packets 24306?bytes 25852361 (24.6 MiB)
????RX errors 0?dropped 5727?overruns 0?frame 0
????TX packets 12084?bytes 1330634 (1.2 MiB)
????TX errors 0?dropped 0 overruns 0?carrier 0?collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING>?mtu 65536
????inet 127.0.0.1?netmask 255.0.0.0
????inet6 ::1?prefixlen 128?scopeid 0x10<host>
????loop?txqueuelen 1000?(Local Loopback)
????RX packets 0?bytes 0 (0.0 B)
????RX errors 0?dropped 0?overruns 0?frame 0
????TX packets 0?bytes 0 (0.0 B)
????TX errors 0?dropped 0 overruns 0?carrier 0?collisions 0
?
[root@workstation ~]# route -n
Kernel IP routing table
Destination???Gateway?????Genmask?????Flags Metric Ref??Use Iface
0.0.0.0?????192.168.122.1??0.0.0.0?????UG??100??0????0 enp1s0
192.168.122.0??0.0.0.0?????255.255.255.0??U???100??0????0 enp1s0
[root@workstation ~]# cat /etc/resolv.conf?
# Generated by NetworkManager
nameserver 8.8.8.8?
[root@workstation ~]#?