Published on

Linux TCP IP

Authors
  • Name
    Jackson Chen

References

How to change IP adress

https://devconnected.com/how-to-change-ip-address-on-linux/

  1. Netowrk file on RHEL and Centos
# Verify the network interface
ls -l /etc/sysconfig/network-scripts

# Update network interface config file
vi /etc/sysconfig/network-scripts/ifcfg-ens162      # example

#** Restart network service for the changes to be applied 
# RHEL 7
    systemctl restart network.service
    systemctl restart network

# RHEL 8
    systemctl restart NetworkManager.service
    systemctl stop NetworkManager.service && systemctl start NetworkManager.service

Note:
    When "ip a" or "ip a | grep inet", and if the IP address has not been change, then need to run
        nmcli networking off && nmcli networking on
  1. Using Network Manager
# Update interface ip address
nmcli device modify <interface_name> ipv4.address <ip_address>

# reapply parameters to the current connection
nmcli device reapply <interface_name>

# restart networking
# using one of the following commands
nmcli networking off && nmcli networking on
nmcli networking off ; nmcli networking on
  1. Using nmtui https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/7/html/networking_guide/sec-configuring_ip_networking_with_nmtui

https://lpar2rrd.com/appliance-setup.php

# Access nmtui text interface console
nmtui

# Deactivate/Activate to take effect
1. Select "Activate a connection"   # press enter twice
2. Select "Deactivate", then
3. Select Activate