Make bridge multiple network interfaces on Xen host to guests os.

ขั้นแรกให้สร้าง script file ขึ้นมาโดยใช้คำสั่ง

#vi /etc/xen/scripts/network-xen-custom

จากนั้น copy ข้อความด้านล่างไปไว้ที่ไฟล์

#!/bin/sh
# network-xen-custom
# Exit if anything goes wrong
set -e
# First arg is operation.
OP=$1
shift
script=/etc/xen/scripts/network-bridge
case ${OP} in
   start)
        $script start vifnum=0 bridge=xenbr0 netdev=eth0    # map xenbr0 -> eth0
        $script start vifnum=1 bridge=xenbr1 netdev=eth1 ;; # map xenbr1 -> eth1
   stop)
        $script stop vifnum=0 bridge=xenbr0 netdev=eth0     #unmap xenbr0
        $script stop vifnum=1 bridge=xenbr1 netdev=eth1 ;;  #unmap xenbr1
   status)
        $script status vifnum=0 bridge=xenbr0 netdev=eth0
        $script status vifnum=1 bridge=xenbr1 netdev=eth1
        ;;
        *)
        echo "Unknown command:${OP}"
        echo 'Valid commands are: start, stop, status'
        exit 1
esac

เมื่อทำการสร้างไฟล์นี้เสร็จเรียบร้อยแล้ว ให้ทำการ chmod เพื่อให้ไฟล์นี้สามารถรันได้

#chmod 755 /etc/xen/scripts/network-xen-custom

จากนั้นให้ทำการแก้ไขไฟล์ config ของ xen โดยใช้คำสั่ง

#vi /etc/xen/xend-config.sxp

แก้ไขและเพิ่มข้อความดังตัวอย่างด้านล่างโดยการ comment script เก่าและเพิ่ม script ใหม่ที่เราสร้างขึ้น

#(network-script network-bridge)

(network-script network-xen-custom)

Related posts:

  1. Bridge multiple network interfaces to guest OS สร้างไฟล์ /etc/xen/scripts/network-xen-custom โดยใช้คำสั่ง #vi /etc/xen/scripts/network-xen-custom ทำการ copy script...
  2. Other Virtual network interfaces go down when bring down virtual network interfaces เคยเกิดปัญหาไหม ถ้าเราทำการสร้าง Virtual network interfaces ขึ้นมาหลายๆ interface และพบว่าเมื่อเรา...
  3. Configure VLAN devices over a bond interface ใน Linux เราสามารถตั้งค่าของ VLAN network ได้ไม่ยาก ซึ่ง Linux...
  4. Network Card Bonding On Red Hat Linux and CentOS Channel Bonding เป็นวิธีการนำเอา network interface card หลายๆใบมารวมกันเพื่อให้สามารถ ขยาย...
  5. Install fully virtualized Windows 2003 as a guest O/S on Xen. ในการติดตั้ง windows ลงบน xen ของ Linux จะมีการติดตั้งที่ยุ่งยากกว่า virtualization...

You can leave a response, or trackback from your own site.

Leave a Reply