Page 95 - RHEL8 BOOK
P. 95
Networking-IP Addressing
1 9 2 .1 6 8 .1 .1
1 9 2 . 1 6 8 . 1 . 2 5 4 1 9 2 .1 6 8 .1 .2
1 9 2 .1 6 8 .1 .3
IP Address Assignment
IP Address can be:
Static IP Address
Address that are manually assigned and do not change over time.
Dynamic IP Address
Addresses that are automatically assigned for a specific period of time and can change
after this period is over.
1. To Set The hostname temporarily
[root@Sun ~]# hostname sun.idesign.com
2. To view The hostname
[root@Sun ~]# hostname
3. Set hostname permanently(RHEL7)
[root@Sun ~]# hostnamectl set-hostname sun.idesign.com
[root@Sun ~]# vi /etc/sysconfig/network(RHEL6)
4. For Graphical avoiding the hostname change in below file
[root@sun ~]# vi /etc/hosts
192.168.10.1 sun sun.idesign.com
5. set ip address temporarily
[root@sun ~]#ifconfig enp0s3 192.168.1.1 netmask 255.255.255.0
or
[root@sun ~]#nmcli con mod enp0s3 ipv4.addresses 192.168.1.1/24
6. Set the manual configuration (from dhcp to static)
[root@sun ~]#nmcli con mod enp0s3 ipv4.method manual
7. To view the ip address enp0s3
[root@ sun ~]#ifconfig enp0s3
8. To view the Interface.
[root@ sun ~]# ifconfig
[root@ sun ~]# ip addr show
[root@ sun ~]# ip addr show enp0s3
S. Pradhan
(MCA, MBA-IT, BCA, CCNA, MCSA 2012, RHCE, ETHICAL HACKING)
Email Id:-spradhan.iiht@gmail.com
95