Page 149 - RHEL8 BOOK
P. 149

Configuring Routing

























          1. Set ip address temporarily
          [root@Sun ~]# ifconfig enp0s3 192.168.10.1 netmask 255.255.255.0

          2. set ip address temporarily
          [root@Sun ~]# ifconfig eth0 192.168.40.1 netmask 255.255.255.0

          3. To view the ip address enp0s3
          [root@Sun ~]# ifconfig enp0s3

          4. To view the ip address eth0
          [root@Sun ~]# ifconfig eth0

          5. Set permanent ip address at graphical mode
          [root@Sun ~]# nmtui

          6. Restart the Service to activate address
          [root@Sun ~]# syste,ctl restart network.service

          7. Configuring Routing - Temporary
          [root@Sun ~]# echo 1 > /proc/sys/net/ipv4/ip_forward

          8. Configuring Routing - Permanent
          [root@Sun ~]# vi /etc/sysctl.conf

          9. Static Route
          [root@Sun ~]#route add -net 192.168.50.0 netmask 255.255.255.0 gw 192.168.10.2 dev eth0

          10. To see the IP address files location
          [root@Sun~]# cd /etc/sysconfig/network-scripts/
          [root@Sun]#vi route-eth0
          ADDRESS0=192.168.50.0
          NETMASK0=255.255.255.0
          GATEWAY0=192.168.10.2



                                                       S. Pradhan
                             (MCA, MBA-IT, BCA, CCNA, MCSA 2012, RHCE, ETHICAL HACKING)
                                             Email Id:-spradhan.iiht@gmail.com
                                                           149
   144   145   146   147   148   149   150   151   152   153   154