Hello people
While practicing RHEL6, I found couple of commands, that can be used frequently in Linux system administration or they can be very useful, when we wish to change some settings related to hostname, NIS domain, DNS, adding DNS entries like IP address and all.
Note :- all commands that we perform or run on Linux are case sensitive and even small space does make a difference.
Here we go
- vim /etc/sysconfig/network
When you enter this command at root # prompt, you can change or modify settings of IPV4 & IPV6
by defult you will see NETWORKING=yes :- this is IPV4 state
if you wish to change it to IPV6 modify it to :- NETWWORKING_init6=yes & you are done with it.
You can also add your hostname & NIS domain name here in this file
Make sure (vim) is a eidtor, it has command mode, execution mode, so when you wish to modify this file, Please type (i) and can write / modify
Save and exit by :- Esc - semi co symbol (:) - wq (write & quit)
You'll be out of this file, to implement changes you restart your network service or system
by command - service network restart OR reboot
to check and confirm, you can also use command
# cat /etc/sysconfig/network
This command will only execute the content, you won't be able to modify it. For modification use above command.
- vim /etc/sysconfig/network-scripts.ifcfg.eth0
here - eth0 - is NIC card one which is installed in my Linux 6, so when you have another NIC card it will be eth1
Simple understanding Ethernet Wired Card - eth & Wireless Card - wlan
Linux OS works on some different concept so when you add IP address through (ifconfig command)
it stores IP address temporary & also the NIC card get down after network service restart or system reboot.
In above command we can set following things like
ONBOOT=yes :- This keeps NIC alive even after network service restart / system reboot; If you say (no) it will bring the NIC card down after network service restart or system reboot
You can mention your system IP address & Netmask / Subnet Mask also
You can eneable IPV6=enable
USERCTL :- Thsi option is to ensure that no user other than root, can access this file. Ofcourse you can modify this option, however not recommended under system administration.
Please don't forget to restart you network service / system reboot to implement changes
This file is to add / modify IP address or FQDN in Linux, same like what we have in Windows
after adding data to this fiule, restart your system / network service
This is usually used by DNS client to contact other DNS server in our Infrastructure, Only you should know the IP address / FQDN of that DNS server
so when you wish to add IP address say :- nameserver 192.168.1.1 OR DOMAIN mickey.mouse.com
save and exit this file, restart your network service / system & done with it
Also ensure, if you add # before any of the entries, that you do in all vim commands, they will be considered as disabled.
So if you wish to disable a perticular entry, just add # before that entry or can delete that entry.
I Thank you for your time & Happy to help you