Pages

Friday, December 18, 2015

Working with Network on CentOS/RHEL 07 Part 10


Configure Static IP address using ip command

- IP adddress assignment using command “ip” is to be used for temporary purpose as post server restart or NetworkManagaer Daemon restart the IP addressed assigned using “ip” command is lost.
- So “ip” command is not to be used for final confiuguration, instead nmtui or file based monification should be preferred for permanent changes in the IP address assignment and related configuration.
- First we will see current properties of the Interface to which ip address is to be assigned using “ip” command

[root@myserver2 ~]# ip a sh dev enp0s10
5: enp0s10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:94:3e:02 brd ff:ff:ff:ff:ff:ff

- Also when checked using “nmtui” command it found to be disabled as below,


- Now get the IP address assigned using ‘ip’ command as shown below,

[root@myserver2 ~]# ip addr add 192.168.50.10/24 dev enp0s10

- Check whether IP address assigned to session properly or not

[root@myserver2 ~]# ip a sh dev enp0s10
5: enp0s10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:94:3e:02 brd ff:ff:ff:ff:ff:ff
    inet 192.168.50.10/24 scope global enp0s10
       valid_lft forever preferred_lft forever

- Now check for any changes in interface configuration setting changes through “nmtui” command, you will still find the interface disabled as below.


- Above things proves that changes made using “ip” command are not permanent.

No comments:

Post a Comment