RSS구독하기:SUBSCRIBE TO RSS FEED
즐겨찾기추가:ADD FAVORITE
글쓰기:POST
관리자:ADMINISTRATOR

1. PXE BOOT?

사전 부팅 실행 환경 또는 간단히 PXE(Pre-boot eXecution Environment)는 네트워크 인터페이스를 통해 컴퓨터를 부팅할 수 있게 해주는 환경이다.

 

2. PXE 구성 요소

요즘 대부분의 서버들에도 PXE 지원하는 네트워크 카드가 설치 되어 있으니 만약 DVD-ROM이 없거나, Bootable USB가 인식이 되지 않을 때 유용하다.

 

l  PXE Server - 부트 이미지 파일을 포함한 설정정보 교환.

l  TFTP Server - 부트 이미지 파일을 전송.

l  PXE Client - PXE 지원 네트워크 카드 필요(2000년 이후 출시된 제품에는 대부분 장착)

 

3. TFTP 설정법

다운로드 : http://tftpd32.jounin.net/

 

기본 실행 화면



GLOBAL 설정 화면

 

기본적으로 TFTP Server DHCP Server는 켜 있어야 한다.

 

TFTP server boot 이미지를 전송하는 프로토콜이며, 실질적은 FTP 서버가 아님을 기억하자.

 

DHCP PXE 부팅을 하기 위해 IP를 할당 받기 위한 서버이다.

 

 



TFTP
설정

 



TFTP
설정은 기본으로 두면 된다.

TFTP는 기본적으로 UDP 69포트를 사용한다.

 

만약 구성하고 있는 서버에 다수의 대역의 IP를사용 중이라면 Bind TFTP to this address 항목에서 사용할 대역을 설정 해 준다.

이렇게 하면 조금 더 빨리 IP할당을 해 준다.



DHCP
설정 화면


 


DHCP
설정이 가장 중요하다.

 

리눅스 DHCP설정과 별반다를 것이 없지만 여기에서 가장 중요한 것은 pxelinux.0 파일 설정

 

이 파일은 linux 설치 시 syslinux 패키지에 포함 되어 있다. 해당 버전을 다운 받아 놓자.

 

* CAUTION

RHEL 5버전의 pxeliux.0 menu.c32파일을 가지고는 RHEL 6버전의 PXE 부팅이 되지 않는다! 필히 최신버전인 RHEL 6버전의 pxelinux.0 menu.c32파일을 구비 해 두자.

 

 

 

4. 디렉토리 구성

TFTP압축을 풀면 달랑 파일 몇 개만 있다. 이 상태로만 쓸 수 있는 것이 아니며, 하위 폴더에 파일 및 디렉토리를 생성하여야 한다.

 


필수 디렉토리

pxelinux.cfg : syslinux.cfg 파일과 동일한 역할을 하는 디렉토리로, 디렉토리 안에 default 라는 파일이 있어야 한다.(구성은 syslinux.cfg 파일과 100% 동일하니 잘 구성된 syslinux.cfg 파일이 있다면 이름만 바꾸어서 사용해도 된다.)

 

필수 파일

pxelinux.0 : 부트로더 파일

menu.c32 : 설치 시 메뉴를 보여주기 위한 파일

 

기타 설정 파일

ks : kickstart 용 파일을 모아 둠

vesamenu.c32 : 그래픽 한 환경설정을 위한 파일

rhel5.X : rhel 5.X 버전의 ISO를 풀어서 넣어둠

rhel6.X : rhel 6.X 버전의 ISO를 풀어서 넣어둠

 

5. 참조 URL

http://tftpd32.jounin.net/tftpd32_download.html

http://www.syslinux.org/wiki/index.php/PXELINUX

Trackback
Reply
간혹 서버에 설치 하기 위해 돌아다니다 보면 DVD-ROM이 없는 서버가있다.
꼭 그럴경우가 아니라 장애대응을 나갔다가 OS를 재 설치 해야하는경우가 생긴다. 이럴 경우 간단히 ISO 파일을 가지고 설치용 USB를 만들 수 있다.

이전글 :  2012/02/21 - [My Advanced Linux/Advanced Linux] - How do I create a bootable USB pen drive to start a Red Hat Enterprise Linux installation?

하지만 Windows에서도 간단히 만들 수 있게해주는 오픈 소스가 있어 소개 한다.

http://iso2usb.sourceforge.net/ 

ISO를 Bootable USB로 만들어 주는 여러 툴이 있는데, RHEL과 CentOS라면 이 툴을  추천한다.
(이 툴은 UNetbootin을 기반으로 만들어 졌기 때문에 사실상 인터페이스는 똑같다)

 
 

1. Diskimage에 5.x/6.x버전에 해당하는 ISO 이미지를 넣는다

2. Type에 USB와 Dirve을 지정한다.

3. OK를 클릭한다 


생각보다 금방 완료가 된다.
별도로 해 줄 작업이 없이 해당 USB를 꼽으면 기존 DVD를 넣고 설치하는 것과 동일한 모습을 볼 수 있다.


그리고 몇 가지 팁을 더 주자면 syslinux.cfg를 수정하여 멀티 설치버전 이미지를 넣을 수 있다.
syslinux.cfg 수정법은 조금만 검색하면 쉽게 알 수 있으니 별도로 설명 하진 않겠다. 이걸 이용하여 kickstart파일까지 만들면 USB 삽입 후 클릭 한번으로 OS 설치가 가능해진다 ~


Trackback
Reply

last modified by Raghu Udiyar on 12/09/11 - 15:24

Release found: Red Hat Enterprise Linux 5

Problem

You need to install Red Hat Enterprise Linux on a server which does not have a floppy drive or CD-ROM drive, but which does has a USB port.

Assumptions

  • Your network environment is not set up to allow Red Hat Enterprise Linux to be installed completely from the network (through PXE boot). If it is, please make use of this option, as it is more straightforward than the procedure documented here.
  • Your network environment is configured to provide the contents of the Red Hat Enterprise Linux DVDs through a protocol supported by the Red Hat Enterprise Linux installer, such as NFS or FTP.
  • The server's BIOS supports booting from a USB mass storage device like a flash/pen drive.

Solution

The following steps configure a USB pen drive as a boot medium to start the installation of Red Hat Enterprise Linux.

  1. Attach the USB pen drive to a system which is already running Red Hat Enterprise Linux.
  2. Run

    dmesg

  3. From the dmesg output,  identify the device name under which the drive is known to the system.

    Sample messages for a 1 Gb flash disk being recognized as /dev/sdb:

    Initializing USB Mass Storage driver... scsi2 : SCSI emulation for USB Mass Storage devices usb-storage: device found at 5 usb-storage: waiting for device to settle before scanning usbcore: registered new driver usb-storage USB Mass Storage support registered.   Vendor: USB 2.0   Model: Flash Disk        Rev: 5.00   Type:   Direct-Access                      ANSI SCSI revision: 02 SCSI device sdb: 2043904 512-byte hdwr sectors (1046 MB) sdb: Write Protect is off sdb: Mode Sense: 0b 00 00 08 sdb: assuming drive cache: write through SCSI device sdb: 2043904 512-byte hdwr sectors (1046 MB) sdb: Write Protect is off sdb: Mode Sense: 0b 00 00 08 sdb: assuming drive cache: write through sdb: sdb1 sd 2:0:0:0: Attached scsi removable disk sdb 
    sd 2:0:0:0: Attached scsi generic sg1 type 0

    usb-storage: device scan complete

  4. Note: For the remainder of this article, we will assume this device name to be /dev/sdb. Make sure you adjust the device references in the following steps as per your local situation.

  5. At this point, the flash drive is likely to have been automatically mounted by the system. Make sure the flash drive is unmounted. E.g. in nautilus, by right-clicking on the icon for the drive and selecting Unmount Volume.
  6. Use fdisk to partition the flash drive as follows:
    • There is a  single partition.
    • This partition is numbered as 1.
    • Its partition type is set to 'b' (W95 FAT32).
    • It is tagged as bootable.
  7. Format the partition created in the previous step as FAT:

    mkdosfs /dev/sdb1

  8. Mount the partition:

    mount /dev/sdb1 /mnt

  9. Copy the contents of /RedHat/isolinux/ from the first installation CD/DVD onto the flash drive, i.e. to /mnt.

    Note: the files isolinux.binboot.cat and TRANS.TBL are not needed and can thus be removed or deleted.

  10. Rename the configuration file:

    cd /mnt/; mv isolinux.cfg syslinux.cfg

  11. Copy the installer's initial RAM disk /RedHat/images/pxeboot/initrd.img from the first installation CD/DVD onto the flash drive, i.e. to /mnt.

  12. Optional step: To configure any boot settings, edit the syslinux.cfg on the USB flash drive. For example to configure the installation to use a kickstart file shared over NFS, specify the following:

    linux ks=nfs:://ks.cfg

  13. Unmount the flash drive:

    umount /dev/sdb1

  14. Make the USB flash drive bootable. The flash drive must be unmounted for this to work properly.

    syslinux /dev/sdb1

  15. Mount the flash drive again:

    mount /dev/sdb1 /mnt

  16. Install GRUB on the USB flash drive:

    grub-install --root-directory=/mnt /dev/sdb

  17. Verify that the USB flash drive has a /boot/grub directory. If it does not, create the directory manually.

    cd /mnt

    mkdir -p boot/grub

  18. Create the grub.conf file. Below is a sample grub.conf:

    default=0 timeout=5 root (hd1,0) title Red Hat Enterprise Linux installer 
    kernel /vmlinuz

    initrd /initrd.img

  19. Copy or confirm the created grub.conf file is on the /boot/grub/ directory of the USB flash drive.

  20. Unmount the flash drive:

    umount /dev/sdb1

  21. At this point, the USB disk should be bootable.

  22. Attach the USB disk to the system you wish to install Red Hat Enterprise Linux on.
  23. Boot from the USB disk. Refer to the hardware vendor's BIOS documentation for details on changing the order in which devices are checked for booting from.
  24. Once you are booted in the Red Hat Enterprise Linux installer, continue with your network installation of choice.
Trackback
Reply
본딩을 일일히 구성하는게 귀찮아진 나머지 스크립트를 짜려다, 혹시나 해서 검색해보니 좋은 스크립트가 있어서 소개!
출처는 맨 아래 적어놓았으며, 약간의 수정을 했다^^




#!/bin/sh
# This script creates bonding interfaces on RHEL 5.
#
# The first and second parameters are used to specify the enslaved interfaces.
# The third parameter is used to describe the name of the bonding interface.
# The network configuration is collected from the first device.
# After running the script please verify the/etc/modprobe.conf file as well as
# all/etc/sysconfig/network-scripts/ifcfg* files!
#
# LICENSE INFORMATION
#
# This software is released under the BSD license:
#
# Copyright 2010 Reiner Rottmann reiner[at]rottmann.it. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this list
# of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice, this
# list of conditions and the following disclaimer in the documentation and/or other
# materials provided with the distribution.
#
# 3. The name of the author may not be used to endorse or promote products derived
# from this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
# BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Global variables

SCRIPTNAME=$(basename $0 .sh)

EXIT_SUCCESS=0
EXIT_FAILED=1
EXIT_ERROR=2
EXIT_BUG=10

VERSION="1.0.0"

# Base functions

# This function displays the basic usage
function usage {
echo "Usage: $SCRIPTNAME <first slave interface> <second slave interface> <bonding interface> <ipaddress> <netmask> <gateway>" >&2
echo "This script bonds two network interfaces on RHEL 5 with the static network config from the first slave interface." >&2
echo >&2
echo "e.g. # ./$SCRIPTNAME eth1 eth3 bond1 192.168.5.250 255.255.255.0 192.168.5.1" >&2
echo >&2
[[ $# -eq 1 ]] && exit $1 || exit $EXIT_FAILED
}

# This function checks that the command is run with the right parameters
function preflightcheck {

# This script needs to be run as root.
if [ $(id -u) -ne 0 ]; then
echo "You need to be root to run this script."
exit $EXIT_FAILED
fi

# Check if we have exactly 3 commandline parameters.

if [ $# -ne 6 ]; then
echo "Commandline parameter is missing. (only $# present)."
usage
exit $EXIT_FAILED
fi

# Check if the first input is correct.
if ! echo $1|grep -q "^eth[0-9]$"; then
echo "The first parameter needs to be an ethernet device (e.g. eth1)."
usage
exit $EXIT_FAILED
fi

# Check if the second input is correct.
if ! echo $2|grep -q "^eth[0-9]$"; then
echo "The second parameter needs to be an ethernet device (e.g. eth3)."
usage
exit $EXIT_FAILED
fi

# Check if the third input is correct.
if ! echo $3|grep -q "^bond[0-9]$"; then
echo "The third parameter needs to be a bonding device (e.g. bond3)."
usage
exit $EXIT_FAILED
fi
}

# The main function that creates the bonding devices.
function rh5mkbond {

# Load the bonding kernel module with active-backup mode and set mii link monitoring to 100 ms.
cp /etc/modprobe.conf /tmp/modprobe.conf.bonding
cat >> /tmp/modprobe.conf.bonding <<EOF
alias $3 bonding
EOF
cat /tmp/modprobe.conf.bonding|uniq > /etc/modprobe.conf


# Get interface details
#IP=$(/sbin/ifconfig $1|egrep -o "([0-9]{1,3}\.){3}[0-9]{1,3}"|sed -n "1p")
#NETMASK=$(/sbin/ifconfig $1|egrep -o "([0-9]{1,3}\.){3}[0-9]{1,3}"|sed -n "3p")
MACIF1=$(/sbin/ifconfig $1|egrep -o "([[:xdigit:]]{2}[:]){5}[[:xdigit:]]{2}")
MACIF2=$(/sbin/ifconfig $2|egrep -o "([[:xdigit:]]{2}[:]){5}[[:xdigit:]]{2}")


# Create the bond0 device file.
mv /etc/sysconfig/network-scripts/ifcfg-$3 /etc/sysconfig/network-scripts/ifcfg-$3.orig  2>/dev/null
cat >> /etc/sysconfig/network-scripts/ifcfg-$3 <<BOND
DEVICE=$3
BOOTPROTO=none
IPADDR=$4
NETMASK=$5
GATEWAY=$6
USERCTL=no
BONDING_OPTS="mode=0 miimon=100"
BOND


# Create the slave device files.
for i in $1 $2
do
mv  /etc/sysconfig/network-scripts/ifcfg-$i  /etc/sysconfig/network-scripts/ifcfg-$i.orig 2>/dev/null
cat >> /etc/sysconfig/network-scripts/ifcfg-$i <<IFS
DEVICE=$i
BOOTPROTO=none
HWADDR=$(/sbin/ifconfig $i|egrep -o "([[:xdigit:]]{2}[:]){5}[[:xdigit:]]{2}")
ONBOOT=yes
MASTER=$3
SLAVE=yes
USERCTL=no
IFS
done

}

# Call functions
preflightcheck $1 $2 $3 $4 $5 $6
rh5mkbond $1 $2 $3 $4 $5 $6

# End script

exit $EXIT_SUCCESS
Trackback
Reply

linux 설치 후 DAEMON을 정리하기 귀찮아서 만든 쉘이라고 하기에도 민망한 스크립트 -_-;;

#!/bin/bash
# created by uzoogom at 2012.2.13

export LC_ALL=C

RED='\e[1;31m'
GREEN='\e[1;32m'
YELLOW='\e[1;33m'
BLUE='\e[1;34m'
NC='\e[0m'

chkall=$(chkconfig --list | egrep "(on|off)" | awk '{print $1}')
chkon=$(cat chklist.txt | egrep -v "^#")

# ALL DEAMON STOP
echo -e "ALL DEAMON STOP ========================================================="
for chkalloff in $chkall
do
chkconfig --level 2345 $chkalloff off
service $chkalloff stop 1>/dev/null
        echo -e "$chkalloff is ${RED}OFF${NC}"
done
echo "Done====================================================================="

echo ""

# SELECT DEAMON START
echo -e "SELECT DEAMON START ====================================================="
for chkselect in $chkon
do
chkconfig --level 2345 $chkselect on
service $chkselect start 1>/dev/null
echo -e "$chkselect is ${GREEN}ON${NC}"
done
echo "Done====================================================================="

echo ""

# selinux disabled
echo "selinux status==========================================================="
setenforce 0 1>/dev/null
perl -pi -e 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
grep "SELINUX=" /etc/selinux/config | egrep -v "^#"

Trackback
Reply

Configuring bonded devices on Red Hat Enterprise Linux 6

Configuring bonded devices
Single bonded device

For the detailed manual of bonding configuration on RHEL6, please refer to,

 

Note : Ensure that Network Manager is not running on the system, as NM does not support bonding :

service NetworkManager stop
chkconfig NetworkManager off

 

 

  • To configure the bond0 device with the network interface eth0 and eth1, perform the following steps:

 

  1.  Create a new file as root named bonding.confin the /etc/modprobe.d/ directory.  Insert the following line in this new file:

alias bond0 bonding

  2.   Create the channel bonding interface file  ifcfg-bond0 in the /etc/sysconfig/network-scripts/ directory:

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"

Note:

  • Configure the bonding parameters in the file /etc/sysconfig/network-scripts/ifcfg-bond0, as above, BONDING_OPTS="mode=0 miimon=100".
  • The behavior of the bonded interfaces depends upon the mode. The mode 0 is the default value, which causes bonding to set all slaves of an active-backup bond to the same MAC address at enslavement time. For more information about the bonding modes, refer to The bonding modes supported in Red Hat Enterprise Linux.

 

  3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth0.  Both eth0 and eth1 should look like the following example:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.

 

  4.   Restart the network service:

# service network restart
Note: It may be necessary to disable NetworkManager if you find that bonding is not working properly. To do this, you would run the following:

 

# service NetworkManager Stop

# chkconfig NetworkManager off

# service Network restart

 

  5.   In order to check the bonding status, check the following file:

# cat /proc/net/bonding/bond0
 
Multiple bonded device

Configuring multiple bonding channels is similar to configuring a single bonding channel. Setup the ifcfg-bond<N> and ifcfg-eth<X> files as if there were only one bonding channel. You can specify different BONDING_OPTS for different bonding channels so that they can have different modes and other settings. Refer to the section 4.2.2. Channel Bonding Interfaces in the Red Hat Enterprise Linux 6 Deployment Guide for more information.

 

To configure the bond0 device with the ethernet interface eth0 and eth1, and configure the bond1 device with the Ethernet interface eth2 and eth3,  perform the following steps:

  1.  Create configuration file /etc/modprobe.d/bonding.conf with the following lines:

alias bond0 bonding
alias bond1 bonding

  2.   Create the channel bonding interface files ifcfg-bond0 and ifcfg-bond1, in the /etc/sysconfig/network-scripts/ directory:

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"
# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
IPADDR=192.168.30.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=1 miimon=50"

Note: there are different bonding modes for bond0 and bond1. For the bond0 device, it is the balance-rr policy (mode=0).  For the bond1 device, it is thefail_over_mac policy (mode=1)More information about the bonding modes please refer to The bonding modes supported in Red Hat Enterprise Linux

 

   3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth0.  Both eth0 and eth1 should look like the following example:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.

 

  4.   Restart the network service:

# service network restart

  5.   In order to check the bonding status, check the following file:

# cat /proc/net/bonding/bond0

Configuring bonded devices on Red Hat Enterprise Linux 5

Single bonded device on RHEL5

For the detailed manual of bonding configuration on RHEL5, please refer to,

 

To configure the bond0 device with the network interface eth0 and eth1, perform the following steps:

 

  1.   Add the following line to /etc/modprobe.conf:

alias bond0 bonding

  2.   Create the channel bonding interface file  ifcfg-bond0 in the /etc/sysconfig/network-scripts/ directory:

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"

Note:

  • Configure the bonding parameters in the file /etc/sysconfig/network-scripts/ifcfg-bond0, as above, BONDING_OPTS="mode=0 miimon=100".
  • The behavior of the bonded interfaces depends upon the mode. The mode 0 is the default value, which causes bonding to set all slaves of an active-backup bond to the same MAC address at enslavement time. For more information about the bonding modes, refer to The bonding modes supported in Red Hat Enterprise Linux.

 

  3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth0.  Both eth0 and eth1 should look like the following example:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.

 

  4.   Restart the network service:

# service network restart

  5.   In order to check the bonding status, check the following file:

# cat /proc/net/bonding/bond0

 

Multiple bonded device on RHEL5

In Red Hat Enterprise Linux 5.3 (or update to initscripts-8.45.25-1.el5) and later, configuring multiple bonding channels is similar to configuring a single bonding channel. Setup the ifcfg-bond<N> and ifcfg-eth<X> files as if there were only one bonding channel. You can specify different BONDING_OPTS for different bonding channels so that they can have different modes and other settings. Refer to the section 15.2.3. Channel Bonding Interfaces in the Red Hat Enterprise Linux 5 Deployment Guide for more information.

 

To configure the bond0 device with the ethernet interface eth0 and eth1, and configure the bond1 device with the Ethernet interface eth2 and eth3,  perform the following steps:

  1.   Add the following line to /etc/modprobe.conf:

alias bond0 bonding
alias bond1 bonding

  2.   Create the channel bonding interface files ifcfg-bond0 and ifcfg-bond1, in the /etc/sysconfig/network-scripts/ directory:

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=0 miimon=100"
# cat /etc/sysconfig/network-scripts/ifcfg-bond1
DEVICE=bond1
IPADDR=192.168.30.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=1 miimon=50"

Note: there are different bonding modes for bond0 and bond1. For the bond0 device, it is the balance-rr policy (mode=0).  For the bond1 device, it is thefail_over_mac policy (mode=1)More information about the bonding modes please refer to The bonding modes supported in Red Hat Enterprise Linux

 

   3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth0.  Both eth0 and eth1 should look like the following example:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.

 

  4.   Restart the network service:

# service network restart

  5.   In order to check the bonding status, check the following file:

# cat /proc/net/bonding/bond0

 

Configuring bonded devices on Red Hat Enterprise Linux 4

Single bonded device on RHEL4

For a detailed manual for bonding configuration on RHEL4 , please refer to,

 

To configure the bond0 device with the network interface eth0 and eth1, perform the following steps,

  1.   Add the following line to /etc/modprobe.conf,

alias bond0 bonding
options bonding mode=1 miimon=100

Note:

  • Configure the bonding parameters in the file /etc/modprobe.conf. It is different from the configuration of RHEL5. The configuration on RHEL5 you configure all bonding parameters in the ifcfg-bond<x> by passing them in the BONDING_OPTS= variable, while in RHEL4 you need to pass those in the modprobe.conf using 'install'  syntax.
  • For the mode=1, it is the fail_over_mac policy modeMore information about the bonding modes please refer to The bonding modes supported in Red Hat Enterprise Linux

 

2.   Create the channel bonding interface file in the /etc/sysconfig/network-scripts/ directory, ifcfg-bond0

# cat /etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
IPADDR=192.168.50.111
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes

3.   Configure the ethernet interface in the file /etc/sysconfig/network-scripts/ifcfg-eth<N>. In this example, both eth0 and eth1 should look like this:

DEVICE=eth<N>
BOOTPROTO=none
HWADDR=54:52:00:26:90:fc
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

Note:

  • Replace the <N> with the numerical value for the interface, such as 0 and 1 in this example. Replace the HWADDR value with the MAC for the interface.
  • Red Hat suggest that you configure the MAC address of the ethernet card into the file /etc/sysconfig/network-scripts/ifcfg-eth<N>.
  • The "54:52:00:26:90:fc" is the hardware address (MAC) of the Ethernet Card in the system.

 

 

Multiple bonded device on RHEL4

To configure multiple bonding channels on RHEL4, first set up the ifcfg-bond<N> and ifcfg-eth<X> files as you would for a single bonding channel, shown in the previous section.

 

Configuring multiple channels requires a different setup for /etc/modprobe.conf. If the two bonding channels have the same bonding options, such as bonding mode, monitoring frequency and so on, add the b option. For example:

alias bond0 bonding
alias bond1 bonding
options bonding max_bonds=2 mode=balance-rr miimon=100

 

If the two bonding channels have different bonding options (for example, one is using round-robin mode and one is using active-backup mode), the bonding modules have to load twice with different options. For example, in /etc/modprobe.conf:

install bond0 /sbin/modprobe --ignore-install bonding -o bonding0 mode=0 miimon=100 primary=eth0
install bond1 /sbin/modprobe --ignore-install bonding -o bonding1 mode=1 miimon=50 primary=eth2

 

If there are more bonding channels, add one install bond<N> /sbin/modprobe --ignore-install bonding -o bonding<N> options line per bonding channel.

 

Note: The use of -o bondingX to get different options for multiple bonds was not possible in Red Hat Enterprise Linux 4 GA and 4 Update 1.

 

After the file /etc/modprobe.conf is modified, restart the network service:

 

Trackback
Reply
우주곰:지구곰이 아닙니다.
지구곰이 아닙니다.
Categories (190)
Information (5)
About uzoogom (5)
My Advanced Linux (73)
Learning Linux (96)
OperatingSystem (5)
Databases (4)
OpenSource (1)
Tips! (1)
«   2012/02   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29