Page 150 - RHEL8 BOOK
P. 150

Or
          ADDRESS0=192.168.50.0
          NETMASK0=255.255.255.0
          GATEWAY0=192.168.10.2
          ADDRESS1=172.16.1.0
          NETMASK1=255.255.255.0
          GATEWAY1=192.168.0.1
          [root@sun ~]#echo '192.168.50.0/24 via 192.168.10.2' >> /etc/sysconfig/network-scripts/route-eth0
          11. set ip address temporarily
          [root@Moon ~]# ifconfig eth0 192.168.10.2 netmask 255.255.255.0

          12. set ip address temporarily
          [root@Moon ~]# ifconfig eth1 192.168.50.1 netmask 255.255.255.0

          12. To view the ip address eth0
          [root@Moon ~]# ifconfig eth0

          13. To view the ip address eth1
          [root@Moon ~]# ifconfig eth1

          14. Set permanent ip address at graphical mode
          [root@Moon ~]# system-config-network-tui

          15. Restart the Service to activate address
          [root@Moon ~]# service network restart

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

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

          19. Static Route
          [root@Moon ~]#route add -net 192.168.40.0 netmask 255.255.255.0 gw 192.168.10.1 dev eth0

          21. To see the IP address files location
          [root@Moon~]# cd /etc/sysconfig/network-scripts/
          [root@Moon]#vi route-eth0
          ADDRESS0=192.168.40.0
          NETMASK0=255.255.255.0
          GATEWAY0=192.168.10.1
          Or
          ADDRESS0=192.168.40.0
          NETMASK0=255.255.255.0
          GATEWAY0=192.168.10.1
          ADDRESS1=172.16.2.0
          NETMASK1=255.255.255.0
          GATEWAY1=192.168.0.2
          or
          [root@Moon ~]#echo '192.168.40.0/24 via 192.168.10.1' >> /etc/sysconfig/network-scripts/route-eth0



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