Author Archives: sushant

How to add multiple ips in centos 7

In centos 7 by default ifconfig command will not work.
You need to install it using this command yum install net-tools
1.  Create a file in /opt/1.sh
2.  create ip list in an excel sheet,
Example:
ip addr add 198.xxx.xx.xx dev enp6s0f0 label   enp6s0f0:1
ip addr add 198.xxx.xx.xx dev enp6s0f0 label   enp6s0f0:2
ip addr add 198.xxx.xx.xx dev enp6s0f0 label enp6s0f0:3
ip addr add 198.xxx.xx.xx dev enp6s0f0 label enp6s0f0:4
3. Add ips in /opt/1.sh file
4. Execute sh 1.sh for the ips to display in ifconfig
5. For the ips to reflect in ifconfig even after server is rebooted add this command sh /opt/1.sh in /etc/rc.d/init.d/network file and it should be added above exit $rc

Ignore table and dump mysql database

-bash-4.1# mysqldump satmn13_drup189 > satmn13_drup1891.sql
mysqldump: Got error: 1146: Table ‘satmn13_drup189.dr_cache_admin_menu’ doesn’t exist when using LOCK TABLES

-bash-4.1# mysqldump satmn13_drup189 –ignore-table=satmn13_drup189.dr_cache_admin_menu > satmn13_drup1891.sql

Error: exim logged Undefined subroutine &main::user2uid called. LOG: MAIN

Exim error :
LOG: MAIN
cwd=/root 4 args: /usr/sbin/exim -i -v testemail@gmail.com
LOG: MAIN REJECT
F=<root@darkmatter.dnsprotect.com> rejected by non-SMTP ACL: failed to expand ACL string "${if eq{$originator_uid}{${perl{user2uid}{nobody}}}{1}{0}}": Undefined subroutine &main::user2uid called. LOG: MAIN
cwd=/var/spool/exim 8 args: /usr/sbin/exim -v -t -oem -oi -f <> -E1UY3r2-000
root@server-web [~]# /scripts/buildeximconf
Configuration file passes test! New configuration file was installed.
/etc/exim.pl.local.build syntax OK
Enabled system filter options: attachments|spam_rewrite
..........
...
........
/etc/exim.pl.local installed!
razor2 is not installed, disabling it in SpamAssassin to save memory
pyzor is not installed, disabling it in SpamAssassin to save memory
SPF is disabled in exim or unavailable, enabling SPF for SpamAssassin
Refreshing SMTP Mail protection.
root@server-web [~]# cp -rpf /etc/exim.pl.local /etc/exim.pl

How-To disable IPv6 on RHEL6 / CentOS 6 / etc

Proper way of disabling IPv6 subsytem in RedHat Linux 6 / CentOS 6 (dont unload modules or so)

in /etc/sysctl.conf  :  net.ipv6.conf.all.disable_ipv6 = 1

in /etc/sysconfig/network  : NETWORKING_IPV6=no

in /etc/sysconfig/network-scripts/ifcfg-eth0 : IPV6INIT=”no”

disable iptables6 – chkconfig –level 345 ip6tables off

reboot

done

 

Without reboot it can be done using below command to disable IPV6

root@host121 [~]# echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6
root@host121 [~]# echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6

 

However on reboot will need to run same command again as it will revert back to original settings.