technical skills grow

Responsive Ads Here

Saturday, July 24, 2021

Troubleshoot: Assign the static IP | Set the hostname temporarily and permanently | NIC is notworking

Q1:-How to assign the static IP address to the NIC card?
In RHEL - 6 :
# setup
(Move the cursor to Network configuration and press Enter key)
(Move the cursor to Device configuration and press Enter key)
(Select the NIC adapter ie., eth0 and press Enter key)
(Assign the above IP address and other details as per our requirements and move the cursor to "OK" and press Enter key)
(Move the cursor to "Save" to save the changes in device configuration and press Enter key)
(Once again move the cursor to "Save & Quit" button and press Enter key)
(Finally move the cursor to "Quit" button and press Enter key to quit the utility)
(Then restart the network service and check for the IP address by # service network restart command)
(If the change is not reflected with the above service, then restart the network manager by
# service NetworkManager  restart
# ifconfig    (to see the IP address of the NIC card)
# ping < IP address >  (to check whether the IP is pinging or not)
In RHEL - 7 :
# nmcli connection show    (to see all the network connections)
# nmcli device show    (to see the network details if already configured manually or dynamically)
# nmcli connection add con-name "System eth0" ifname eth0 type ethernet 

(to add the network connection)
# nmcli connection modify "System eth0" ipv4.addresses ' < IP address >/< netmask >< gateway > ' ipv4.dns < dns server IP address > ipv4.dns-search < domain name> ipv4.method <static or manually> (to assign IP address, gateway, dns, domain name and configure the network as static or manually)
 

# nmcli connection up "System eth0"  (to up the connection)
# systemctl restart network                 (to restart the network service)
# systemctl enable network                  (to enable the network service)
# ifconfig                                               (to see the IP address of the NIC card)
# ping < IP address >

 

Q2:- How to set the hostname temporarily and permanently?
RHEL - 6 :
# hostname <fully qualified domain name> (to set the hostname temporarily)
# vim /etc/sysconfig/network                        (to set the hostname permanently)
HOSTNAME=<fully qualified domain name>
(save and exit this file)
# service network restart                          (to update the hostname in the network)
# chkconfig network on                            (to enable the connection at next reboot)
RHEL - 7 :
# hostname <fully qualified domain name> (to set the hostname temporarily)
# hostnamectl set-hostname <fully qualified domain name> (to set the hostname permanently)
# systemctl restart network
           (to update the hostname in the network)
# systemctl enable network           (to enable the connection at next reboot)

Q3:- How to troubleshoot if the NIC is networking?
 

(a) First check the NIC card is present or not by # ifconfig command.

(b) If present thencheck the status of the NIC card is enabled or disabledby click on System menu on the status bar, then select Network Connections menu.

(c) Click on IPV4 settings tab, select the device eth0 or any other and select Enable button, then

Apply and OK.

(d)Open /etc/sysconfig/network-scripts/ifcfg-eth0 file check Userctl=yes or no. If it is yes make it as  no, then  check Onboot= yes or no. If it is no make it as yes and save that file.

(e) If not present thencheck the status of the NIC card is enabled or disabled by click on System menu  on the status bar, then select Network Connections menu.

(f) Click on IPV4 settings tab, select the device eth0 or any other and select Enable button, then Apply and OK.

 

(g)Using # setup (in RHEL - 6) or 

# nmcli (in RHEL - 7) commands assign the IP address to the system and restart the network service by

 # service network restart (in RHEL - 6) or 

#  systemctl restart network (in RHEL - 7) commands and enable the service at next reboot by

# chkconfig network on (in RHEL - 6) or
# systemctl enable network (in RHEL - 7) commands.
(h) Then up the connection by # ifconfig eth0 up (in RHEL - 6) or 

# nmcli connection up <connection name> commands.
(i) Even though it is not working may be the fault in NIC card. If so, contact the hardware vendor by taking the permissions from higher authorities.


No comments:

Post a Comment

Powered by Blogger.

Labels

Contact Form

Name

Email *

Message *

Search This Blog

Blog Archive

Ad Code

Responsive Advertisement

Recent Posts