IP Setting on CentOS6 using Shell Script Rumi, December 6, 2015 #!/bin/bash if [ $# -eq 5 ] then echo "" echo "Taking the backup and Changing the hostname from $(hostname) to $1 ..." sed -i.bk "s/$(hostname)/$1/g" /etc/sysconfig/network echo "" echo "Backing up & Assigning the Static IP ..." echo "" cp /etc/sysconfig/network-scripts/ifcfg-$2 /etc/sysconfig/network-scripts/$2.bk cat <<EOF > /etc/sysconfig/network-scripts/ifcfg-$2 DEVICE=$2 BOOTPROTO=static IPADDR=$3.$4 NETMASK=255.255.255.0 GATEWAY=$3.$5 ONBOOT=yes EOF echo "Changing the dns ..." echo "" sed -i.bk "s/nameserver.*/nameserver $3.$5/" /etc/resolv.conf echo "Adding $1 as hostname to the /etc/hosts file .." echo "" sed -i.bk "/$(hostname)$/d" /etc/hosts echo "$3.$4 $1" >> /etc/hosts echo "Restarting the Network Service, Please connect it using the new IP Address if you are using ssh ..." service network restart else echo "Usage: ip.sh <hostname> <interface> <baseip> <ipaddress> <gateway/dns>" echo "Example: ip.sh testname eth0 10.10.10 41 1" fi Related Administrations Configurations (Linux) Scripts BashCentOS
How To Control Access To Unwanted Websites Using URL Blacklist With SafeSquid Proxy Server January 14, 2012January 14, 2012 SafeSquid – Content Filtering Internet Proxy, has many content filtering features that can be used to decide who is allowed what, when and how much on the net. In this tutorial I will describe how to control access to unwanted categories of websites, by using URL Blacklist database with SafeSquid… Read More
Microsoft “Dhaka” daylight savings patch June 18, 2009June 18, 2009 Microsoft Bangladesh today announced a patch based fix to address the Day Light Saving Time (DST) which is supposed to be effective in Bangladesh from June 19th at 11PM. This fix can be downloaded from Microsoft’s corporate website by going to http://support.microsoft.com/kb/972423 and will be applicable to Computers running on… Read More
Change cluster node IP in Proxmox March 4, 2020 To update the present cluster host proxmox following files need to be updated: /etc/network/interfaces /etc/hosts /etc/pve/corosync.conf (only on one node necessary) However, corosync.conf needs special way to edit the file! Edit corosync.conf Editing the corosync.conf file is not always very straightforward. There are two on each cluster node, one in… Read More