Page 100 - RHEL8 BOOK
P. 100

11.    Add default gateway permanently?
           [root@ sun ~]# route add default gw 192.168.1.100 enp0s3
          [root@ sun ~]# nmcli con mod enp0s3 ipv4.gateway 192.168.1.100
          # cat /etc/sysconfig/network
          GATEWAY=192.168.1.100

          12.    To see the Gateway
           [root@ sun ~]# route –nv

          13.    DNS ip address file location
          [root@Sun ~]# nmcli con mod enp0s3 ipv4.dns "8.8.8.8"
          or
          [root@Sun ~]# vi /etc/resolv.conf
          nameserver 8.8.8.8


          14.    To verify the status of Network Manager service:
          [root@sun ~]#systemctl status NetworkManager.service

          15.    To check which network interface is managed by Network Manager, run:
          [root@sun ~]#nmcli device status
          or nmcli dev status (Network Manager Command Line Interface)

          16.    Create a Virtual ip address
          [root@ sun ~]# ifconfig enp0s3:0 192.168.1.2 netmask 255.255.255.0

          17.    Restart the Service to activate the new ip address
          [root@Sun ~]# systemctl restart NetworkManager
          [root@Sun ~]# systemctl restart network.service

          18.    Permanent enable the service
          [root@Sun ~]# systemctl enable NetworkManager
          [root@ sun ~]#systemctl enable network
          [root@ sun ~]#chkconfig network on

          19.    To Set or view the network parameters. Or Status
          [root@Sun ~]# ethtool enp0s3
          [root@ sun ~]#systemctl status network.service

          20.    To disable the NIC card
          [root@Sun ~]# ifdown enp0s3

          21.    To enable the NIC card
          [root@Sun ~]# ifup enp0s3

          22.    To check the NIC card whether detected or not
          [root@Sun ~]# ethtool enp0s3

          23.    To see the IP address files location
          [root@Sun ~]#cd /etc/sysconfig/network-scripts


                                                       S. Pradhan
                             (MCA, MBA-IT, BCA, CCNA, MCSA 2012, RHCE, ETHICAL HACKING)
                                             Email Id:-spradhan.iiht@gmail.com
                                                           100
   95   96   97   98   99   100   101   102   103   104   105