ezylinux
ลินุกซ์ง่ายนิดเดียว

6
Mar

ขั้นแรกให้สร้าง 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 ด้านล่างนี้ไปใส่ไว้ในไฟลฺ์ /etc/xen/scripts/network-xen-custom #!/bin/sh # network-xen-custom # Exit if anything goes wrong...
  2. Other Virtual network interfaces go down when bring down virtual network interfaces เคยเกิดปัญหาไหม ถ้าเราทำการสร้าง Virtual network interfaces ขึ้นมาหลายๆ interface และพบว่าเมื่อเรา down Virtual network interfaces บาง Virtual network interfaces จะทำให้ Virtual network...
  3. Network Card Bonding On Red Hat Linux and CentOS Channel Bonding เป็นวิธีการนำเอา network interface card หลายๆใบมารวมกันเพื่อให้สามารถ ขยาย bandwidth, fail-over interface, load balancing หรือ port trunking 802.3ad และยัง support...
  4. Install fully virtualized Windows 2003 as a guest O/S on Xen. ในการติดตั้ง windows ลงบน xen ของ Linux จะมีการติดตั้งที่ยุ่งยากกว่า virtualization อื่นๆ ตรงที่จะต้องดูว่า cpu ที่ใช้ support การลง os อื่นนอกจาก Linux (fully virtualized)...
  5. Configure VLAN devices over a bond interface ใน Linux เราสามารถตั้งค่าของ VLAN network ได้ไม่ยาก ซึ่ง Linux เองก็ support การทำงานของ VLAN ด้วยเช่นกันโดยใช้ driver 8021q ซึ่งขั้นตอนการติดตั้งที่ยกตัวอย่างมานี้เป็นการทำ bonding channel +...

Category : Network / Virtualization