Red Hat Enterprise Linux 7: Setting up network using nmcli without learning in less than a 30 seconds like a pro!
This procedure will work on server which does not have any NetworkManager connection configured but also on server which has already some NetworkManager connections configured.
1) Find out name of your ethernet device:
2) redirect first 4 lines of “Example 9” from nmcli-examples man page into a file.
man nmcli-examples | grep -A 4 "Example 9" > nmcli.sh
3) modify new file “nmcli.sh” and update it with desired IP address, gateway, DNS servers and given interface name.
nmcli con add con-name my-con-em1 ifname eth0 type ethernet ip4 172.16.99.98/24 gw4 172.16.99.1
nmcli con mod my-con-em1 ipv4.dns "184.108.40.206 220.127.116.11"
nmcli con up my-con-em1
4) Modify permissions of a new file “nmcli.sh” to executable and run the script “nmcli.sh”
chmod a+x nmcli.sh
5) Verify IP address:
6) Verify gateway:
7) Verify /etc/resolv.conf file:
8) Verify DNS server functionality:
9) Verify if remote destination is pingable:
Related Video Tutorials: