°Ô½Ã¹° 42°Ç
   
³×Æ®¿öÅ© ÀÚµ¿ ¼³Á¤ ½ºÅ©¸³Æ® -1 [bond0 ]
±Û¾´ÀÌ : theko ³¯Â¥ : 2015-03-25 (¼ö) 16:14 Á¶È¸ : 6508

###### Network Setting
check="n"
echo -n "4. Network Setting Start ? [y/n] Default [n] : "
read check
if [ $check = "y" ];then
        network_bonding_mode="1"
        network_miimon_time="100"

#       echo -n "Server is vmware ? [y/n] :"
#       read vmware_check

        echo -n "Server Hostname ? :"
        read network_hostname

        echo -n "Network Bonding Name ?  : "
        read network_bonding_name

        echo -n "Slave First Device ? : "
        read network_slave_first_device

        echo -n "Slave Second Device ? : "
        read network_slave_second_device

        echo -n "Ip address ? : "
        read network_ip

        echo -n "Subnetmask ? : "
        read network_mask

        echo -n "Gateway ? : "
        read network_gateway

        echo -n "MTU ? : "
        read network_mtu

HWADDR_0=`ifconfig -a | grep -i $network_slave_first_device | grep HWaddr | awk '{print $5}'`
HWADDR_1=`ifconfig -a | grep -i $network_slave_second_device | grep HWaddr | awk '{print $5}'`
echo "

###########################################################
HOSTNAME        : $network_hostname
Bonding Name    : $network_bonding_name
Bondimg Mode    : $network_bonding_mode
Miimon Time     : $network_miimon_time
First Device    : $network_slave_first_device $HWADDR_0
Second Device   : $network_slave_second_device $HWADDR_1
IP ADDRESS      : $network_ip
NetMask         : $network_mask
Gateway         : $network_gateway
MTU             : $network_mtu
###########################################################"
echo -n "Bonding Setup Start? [y/n]"
read check
        if [ $check = "y" ];then
                echo "alias $network_bonding_name bonding" >> /etc/modprobe.d/bonding.conf

echo "DEVICE=$network_bonding_name
BOOTPROTO=static
IPADDR=$network_ip
NETMASK=$network_mask
onBOOT=yes
USERCTL=no
NM_ConTROLLED=no
BONDING_OPTS=\"mode=$network_bonding_mode miimon=$network_miimon_time\"" > /etc/sysconfig/network-scripts/ifcfg-$network_bonding_name

        if ! [ -z $network_mtu ];then
         echo "MTU=$network_mtu" >> /etc/sysconfig/network-scripts/ifcfg-$network_bonding_name

        fi
        if ! [ -z $network_gateway ];then
        echo "GATEWAY=$network_gateway" >> /etc/sysconfig/network-scripts/ifcfg-$network_bonding_name
        fi

        for ethernet in `echo $network_slave_first_device $network_slave_second_device`
                do
                HWADDR=`ifconfig -a | grep -i $ethernet | grep HWaddr | awk '{print $5}'`

echo "DEVICE=$ethernet
BOOTPROTO=none
HWADDR=$HWADDR
onBOOT=yes
USERCTL=no
MASTER=$network_bonding_name
NM_ConTROLLED=no
SLAVE=yes" > /etc/sysconfig/network-scripts/ifcfg-$ethernet
                done
if ! [ -z $network_hostname];then
echo "127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
$network_ip $network_hostname
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6" > /etc/hosts
echo "NETWORKING=yes
HOSTNAME=$network_hostname" > /etc/sysconfig/network
hostname $network_hostname
fi
service network stop
modprobe $network_bonding_name
service network restart
echo "Network Bonding Setup Suscess"

        fi
fi


À̸§ Æнº¿öµå
ºñ¹Ð±Û (üũÇÏ¸é ±Û¾´À̸¸ ³»¿ëÀ» È®ÀÎÇÒ ¼ö ÀÖ½À´Ï´Ù.)
¿ÞÂÊÀÇ ±ÛÀÚ¸¦ ÀÔ·ÂÇϼ¼¿ä.
   

miwit.com sir.co.kr DNS Powered by DNSEver.com DNS Powered by DNSEver.com