- Build kermel module "bridge"
[root@pveNode ~]$ apt-get install build-essential autoconf libtool pkg-config openssl libssl-dev bridge-utils [root@pveNode ~]$ apt-get install git-core rpm2cpio lintian ncurses-dev [root@pveNode ~]$ git clone git://git.proxmox.com/git/pve-kernel-2.6.32.git pve-kernel [root@pveNode ~]$ mv pve-kernel /usr/src [root@pveNode ~]$ cd /usr/src/pve-kernel ##修改Makefile gcc --version|grep "<b>4.4.5</b>" || false [root@pveNode /usr/src/pve-kernel]$ make [root@pveNode /usr/src/pve-kernel/linux-2.6-2.6.32]$ cd linux-2.6-2.6.32 [root@pveNode /usr/src/pve-kernel/linux-2.6-2.6.32]$ make mrproper [root@pveNode /usr/src/pve-kernel/linux-2.6-2.6.32]$ make clean [root@pveNode /usr/src/pve-kernel/linux-2.6-2.6.32]$ make menuconfig
Networking support -> bridge 改為 M 退出儲存
[root@pveNode /usr/src/pve-kernel/linux-2.6-2.6.32]$ make bzImage [root@pveNode /usr/src/pve-kernel/linux-2.6-2.6.32]$ make modules [root@pveNode /usr/src/pve-kernel/linux-2.6-2.6.32]$ make modules_install [root@pveNode ~]$ cp /usr/src/pve-kernel/linux-2.6-2.6.32/arch/x86_64/boot/bzImage /boot/vmlinuz-2.6.32-20-pve [root@pveNode ~]$ cp /usr/src/pve-kernel/linux-2.6-2.6.32/.config /boot/config-2.6.32-20-pve [root@pveNode ~]$ mkinitramfs -o /boot/initrd.img-2.6.32-20-pve 2.6.32-20-pve [root@pveNode ~]$ cp /usr/src/pve-kernel/linux-2.6-2.6.32/arch/x86_64/boot/bzImage /boot/vmlinuz-2.6.32-20-pve [root@pveNode ~]$ cp /usr/src/pve-kernel/linux-2.6-2.6.32/.config /boot/config-2.6.32-20-pve [root@pveNode ~]$ mkinitramfs -o /boot/initrd.img-2.6.32-20-pve 2.6.32-20-pve在 /boot/grub/grub.cfg 改開機選單 範例如下
menuentry 'Proxmox Virtual Environment GNU/Linux, with Linux 2.6.32-20-pve' --class proxmox --class gnu-linux --class gnu --class os {
insmod part_msdos
insmod ext2
set root='(hd0,msdos1)'
search --no-floppy --fs-uuid --set 9cc709ff-7275-461e-8e91-505d0b1c158f
echo 'Loading Linux 2.6.32-20-pve ...'
linux /vmlinuz-2.6.32-20-pve root=/dev/mapper/pve-root ro quiet
echo 'Loading initial ramdisk ...'
initrd /initrd.img-2.6.32-20-pve
}
- Open vSwitch install
[root@pveNode ~]$ wget http://openvswitch.org/releases/openvswitch-1.4.0.tar.gz [root@pveNode ~]$ tar zxvf openvswitch-1.4.0.tar.gz [root@pveNode ~]$ cd openvswitch-1.4.0 [root@pveNode openvswitch-1.4.0]$ ./boot.sh [root@pveNode openvswitch-1.4.0]$ ./configure --with-linux=/lib/modules/`uname -r`/build CC=gcc-4.4修改 datapath/linux/compat/include/linux/skbuff.h 的函式 skb_frag_page 跟 skb_reset_mac_len
修改 datapath/linux/compat/include/linux/if.h 的變數 IFF_OVS_DATAPATH
修改 datapath/linux/compat/include/linux/if_vlan.h 的函式 vlan_set_encap_proto
將上述更名或註解
[root@pveNode openvswitch-1.4.0]$ make [root@pveNode openvswitch-1.4.0]$ make install [root@pveNode openvswitch-1.4.0]$ rmmod bridge [root@pveNode openvswitch-1.4.0]$ insmod ./datapath/linux/openvswitch_mod.ko [root@pveNode openvswitch-1.4.0]$ insmod ./datapath/linux/brcompat_mod.ko
- Open vSwitch Setup
[root@pveNode ~]$ mkdir -p /usr/local/etc/openvswitch [root@pveNode ~]$ ovsdb-tool create /usr/local/etc/openvswitch/conf.db ./vswitchd/vswitch.ovsschema [root@pveNode ~]$ ovsdb-server ovsdb-server --remote=punix:/usr/local/var/run/openvswitch/db.sock \ --remote=db:Open_vSwitch,manager_options \ --private-key=db:SSL,private_key \ --certificate=db:SSL,certificate \ --bootstrap-ca-cert=db:SSL,ca_cert \ --detach [root@pveNode ~]$ ovs-vswitchd unix:/usr/local/var/run/openvswitch/db.sock --detach [root@pveNode ~]$ ovs-brcompatd --pidfile --detach #set Network [root@pveNode ~]$ ovs-vsctl add-br vmbr0 [root@pveNode ~]$ ovs-vsctl add-port vmbr0 eth0 [root@pveNode ~]$ ovs-vsctl show [root@pveNode ~]$ ifconfig eth0 0 [root@pveNode ~]$ ifconfig vmbr0 192.168.88.100 netmask 255.255.255.0 [root@pveNode ~]$ route add default gw 192.168.88.2
參考 configure Openvswitch on Proxmox VE
沒有留言:
張貼留言