Wednesday, April 13, 2016

CentOS Basic Configuration

The CentOS Project is a community-driven free software effort focused on delivering a robust open source ecosystem. For users, CentOS offers a consistent manageable platform that suits a wide variety of deployments. For open source communities, CentOS offers a solid, predictable base to build upon, along with extensive resources to build, test, release, and maintain their code.

1. Find Out Installed Package


[[email protected] /]$ rpm -qa |less
plymouth-0.8.9-0.24.20140113.el7.centos.x86_64
libsoup-2.48.1-3.el7.x86_64
libaio-0.3.109-13.el7.x86_64
dmidecode-2.12-9.el7.x86_64
passwd-0.79-4.el7.x86_64
bind-libs-lite-9.9.4-29.el7_2.2.x86_64
sed-4.2.2-5.el7.x86_64
grub2-2.02-0.34.el7.centos.x86_64
libcom_err-1.42.9-7.el7.x86_64
rsyslog-7.4.7-12.el7.x86_64
biosdevname-0.6.2-1.el7.x86_64
dracut-config-rescue-033-360.el7_2.x86_64
libacl-2.2.51-12.el7.x86_64
openssh-clients-6.6.1p1-23.el7_2.x86_64
xe-guest-utilities-6.5.0-1432.x86_64
libgcrypt-1.5.3-12.el7_1.1.x86_64
libpcap-1.5.3-8.el7.x86_64
cronie-1.4.11-14.el7.x86_64
iwl6050-firmware-41.28.5.1-43.el7.noarch
iwl4965-firmware-228.61.2.24-43.el7.noarch
iwl3160-firmware-22.0.7.0-43.el7.noarch
libunistring-0.9.3-9.el7.x86_64
iwl100-firmware-39.31.5.1-43.el7.noarch
perl-parent-0.225-244.el7.noarch
newt-0.52.15-4.el7.x86_64
perl-Pod-Escapes-1.04-286.el7.noarch
gdbm-1.10-8.el7.x86_64
perl-libs-5.16.3-286.el7.x86_64

.......

[[email protected] /]$ rpm -qa |grep syslog

rsyslog-7.4.7-12.el7.x86_64





2. Network Interface Configuration

DHCP or Static:
Step 1 » Check the network interface name by typing below command
[[email protected] ~]# ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 9a:4a:27:66:a4:4c brd ff:ff:ff:ff:ff:ff
    inet 10.9.1.26/24 brd 10.91.128.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::984a:27ff:fe66:a44c/64 scope link 
       valid_lft forever preferred_lft forever
Here “lo” is the loopback interface and “eth0” is the network interface that you need to configure .

Step 2 » you can see the file named ifcfg-eth0 ( Interface name ) in the location “/etc/sysconfig/network-scripts/” , open the file and you can see the lines as below, which is static ip 10.9.1.26 assigned to interface eth0
Just modify the lines like this
DEVICE="eth0"
HWADDR="00:22:19:09:4D:3C"
NM_CONTROLLED="yes"
ONBOOT="yes"    # Interface enabled

BOOTPROTO="dhcp"  #Assigning IP from DHCP
Step 3 » Start the network service and you can see the status as below .
[[email protected]~]# service network start
Bringing up loopback interface:                [  OK  ]
Bringing up interface p4p1:
Determining IP information for p4p1... done.   [  OK  ]



3. Disable IPv6
There are three different ways to do it. 
3.1 Edit Sysctl.conf file

vi /etc/sysctl.conf

Add following two lines:
net.ipv6.conf.all.disable_ipv6 =1
net.ipv6.conf.default.disable_ipv6 =1
if only want to disable IPv6 for specific network card, such as  enp0s3, add following line instead:
net.ipv6.conf.enp0s3.disable_ipv6 =1
Save and exit VI. 
Run following command to make the change effect:
sysctl -p
3.2 
echo 1>/proc/sys/net/ipv6/conf/all/disable_ipv6echo 1>/proc/sys/net/ipv6/conf/default/disable_ipv6
3.3 
sysctl -w net.ipv6.conf.all.disable_ipv6=1sysctl -w net.ipv6.conf.default.disable_ipv6=1
Note: Some caveats to be aware from How to disable IPv6 on Linux.

4. Install IPTABLES 
For Iptables lovers , here are some commands to install it to replace default firewall :
yum install policycoreutils iptables-services -y
systemctl stop firewalld.service
systemctl disable firewalld.service
service iptables restart

5. TBC





Reference:












No comments:

Post a Comment