#egrep '^flags.*(vmx|svm)' /proc/cpuinfo
# cat /etc/redhat-release
# yum install qemu-kvm libvirt libvirt-python libguestfs-tools virt-install -y
# brctl show
bridge name bridge id STP enabled interfaces
virt-mgmt-br 8000.20040fe827d4 no em1
# pwd
/opt/hillstone-cmd-libvirt
# ll
total 2097760
-rw-r--r--. 1 root root 258 Jan 11 15:55 hillstone-br0
-rw-r--r--. 1 root root 135 Jan 11 14:51 hillstone-br1
-rw-r--r--. 1 root root 135 Jan 11 14:52 hillstone-br2
-rw-r--r--. 1 root root 135 Jan 11 14:52 hillstone-br3
-rw-r--r--. 1 root root 135 Jan 11 14:52 hillstone-br4
-rw-r--r--. 1 root root 135 Jan 11 14:52 hillstone-br5
-rwxrwxrwx. 1 root root 762 Jan 11 16:07 install.sh
-rw-r--r--. 1 root root 133 Jan 11 16:09 xyzbr-network.xml
-rw-r--r--. 1 qemu qemu 2148073472 Jan 12 12:17 SG6000-CloudEdge-5.5R5-VM01-v6.qcow2
```shell
* VFW的镜像文件先要准备好
```shell
# ll | grep qcow2
-rw-r--r--. 1 qemu qemu 2148073472 Jan 12 10:57 SG6000-CloudEdge-5.5R5-VM01-v6.qcow2
# cat xyzbr-network.xml
<network>
<name>xyzbr0</name>
<forward mode='bridge'/>
<bridge name='xyzbr0'/>
<virtualport type='openvswitch'/>
</network>
# virsh net-define xyzbr-network.xml
# virsh net-start xyzbr0
# virsh net-autostart xyzbr0
# cat hillstone-br0
<network>
<name>hillstone-br0</name>
<bridge name='virt-mgmt-br' stp='n' delay='0' />
<forward mode='bridge'/>
<ip address='10.25.130.100' netmask='255.255.0.0'>
<dhcp>
<range start='10.25.130.100' end='10.25.130.100.'/>
</dhcp>
</ip>
</network>
# cat hillstone-br1
<network>
<name>hillstone-br1</name>
<forward mode='bridge'/>
<bridge name='xyzbr0'/>
<virtualport type='openvswitch'/>
</network>
# cat install.sh
virt-install \
--name hillstone \
--wait 0 \
--os-type linux \
--virt-type kvm \
--accelerate \
--vnc --vnclisten 0.0.0.0 \
--ram 2048 \
--vcpus 2 \
--boot cdrom \
--disk path=/opt/hillstone-cmd-libvirt/SG6000-CloudEdge-5.5R5-VM01-v6.qcow2,device=disk,bus=ide,format=qcow2 \
--serial tcp,host=0.0.0.0:8123,mode=bind,protocol=telnet \
--network network=xyzbr0,model=virtio,target=he0 \
--network network=xyzbr0,model=virtio,target=he1 \
--network network=xyzbr0,model=virtio,target=he2 \
--network network=xyzbr0,model=virtio,target=he3 \
--network network=xyzbr0,model=virtio,target=he4 \
--network network=xyzbr0,model=virtio,target=he5 \
--network network=xyzbr0,model=virtio,target=he6
# ./install.sh
WARNING No operating system detected, VM performance may suffer. Specify an OS with --os-variant for optimal results.
Starting install...
Domain creation completed.
#
# virsh start hillstone
#
# virsh list
Id Name State
----------------------------------------------------
4 hillstone running
#
# virsh domiflist hillstone
Interface Type Source Model MAC
-------------------------------------------------------
he0 bridge xyzbr0 virtio 52:54:00:9a:51:32
he1 bridge xyzbr0 virtio 52:54:00:44:e3:98
he2 bridge xyzbr0 virtio 52:54:00:9c:ae:d4
he3 bridge xyzbr0 virtio 52:54:00:e8:4b:b8
he4 bridge xyzbr0 virtio 52:54:00:51:ee:11
he5 bridge xyzbr0 virtio 52:54:00:f2:84:0a
he6 bridge xyzbr0 virtio 52:54:00:74:6d:9d
ovs-vsctl set port he2 tag=x
# telnet localhost 8123
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
login:
#VFW配置和验证
##基本配置
configure
interface eth0/0
no ip address dhcp
ip address 10.25.130.100/16
manage ssh
manage ping
manage snmp
manage https
exit
ip vrouter trust-vr
ip route 0.0.0.0/0 10.25.0.1
exit
ha link interface ethernet0/5
ha link ip 2.2.2.1 255.255.255.0
ha group 0
ha cluster 1 node 1
interface eth0/1
zone trust
no ip address dhcp
ip address 10.3.3.254/254
manage ping