mirror of
https://github.com/retspen/webvirtcloud
synced 2026-03-23 11:04:49 +00:00
Added V2 from scratch
This commit is contained in:
parent
5c2232f4e8
commit
6c2925a35d
478 changed files with 21437 additions and 134206 deletions
39
devenv/vagrant/etc/libvirt/hooks/qemu
Normal file
39
devenv/vagrant/etc/libvirt/hooks/qemu
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
#!/bin/bash
|
||||
#
|
||||
# HubGridCloud libvirt qemu hook
|
||||
#
|
||||
|
||||
domain_name="$1"
|
||||
domain_task="$2"
|
||||
network="169.254.0.0/16"
|
||||
|
||||
|
||||
zeroconf_add() {
|
||||
# Get VNET interface
|
||||
target=$(xmlstarlet select -t -m "//devices/interface[@type='bridge']" -v "concat(target/@dev, ' ')" -n | head -1)
|
||||
iface=$(echo ${target} | cut -d- -f2)
|
||||
|
||||
# Add rule for 169.254.0.0/16
|
||||
ebtables -t nat -I "I-${iface}-ipv4-ip" 2 -p IPv4 --ip-src "${network}" -j RETURN
|
||||
ebtables -t nat -I "I-${iface}-arp-ip" -p ARP --arp-ip-src "${network}" -j RETURN
|
||||
}
|
||||
|
||||
|
||||
case "${domain_task}" in
|
||||
prepare)
|
||||
;;
|
||||
started)
|
||||
zeroconf_add
|
||||
;;
|
||||
stopped)
|
||||
;;
|
||||
reconnect)
|
||||
zeroconf_add
|
||||
;;
|
||||
*)
|
||||
exit 0
|
||||
echo "qemu hook called with unexpected options $*" >&2
|
||||
;;
|
||||
esac
|
||||
|
||||
exit 0
|
||||
5
devenv/vagrant/etc/libvirt/networks/private.xml
Normal file
5
devenv/vagrant/etc/libvirt/networks/private.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<network>
|
||||
<name>private</name>
|
||||
<forward mode='bridge'/>
|
||||
<bridge name='br-int'/>
|
||||
</network>
|
||||
5
devenv/vagrant/etc/libvirt/networks/public.xml
Normal file
5
devenv/vagrant/etc/libvirt/networks/public.xml
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
<network>
|
||||
<name>public</name>
|
||||
<forward mode='bridge'/>
|
||||
<bridge name='br-ext'/>
|
||||
</network>
|
||||
|
|
@ -0,0 +1,3 @@
|
|||
<filter name='allow-incoming-ipv6' chain='ipv6' priority='-600'>
|
||||
<rule action='accept' direction='in' priority='500'/>
|
||||
</filter>
|
||||
19
devenv/vagrant/etc/libvirt/nwfilters/clean-traffic-ipv6.xml
Normal file
19
devenv/vagrant/etc/libvirt/nwfilters/clean-traffic-ipv6.xml
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
<filter name='clean-traffic-ipv6' chain='root'>
|
||||
<filterref filter='no-mac-spoofing'/>
|
||||
<filterref filter='no-ip-spoofing'/>
|
||||
<rule action='accept' direction='out' priority='-650'>
|
||||
<mac protocolid='ipv4'/>
|
||||
</rule>
|
||||
<filterref filter='no-ipv6-spoofing'/>
|
||||
<rule action='accept' direction='out' priority='-650'>
|
||||
<mac protocolid='ipv6'/>
|
||||
</rule>
|
||||
<filterref filter='allow-incoming-ipv4'/>
|
||||
<filterref filter='allow-incoming-ipv6'/>
|
||||
<filterref filter='no-arp-spoofing'/>
|
||||
<rule action='accept' direction='inout' priority='-500'>
|
||||
<mac protocolid='arp'/>
|
||||
</rule>
|
||||
<filterref filter='no-other-l2-traffic'/>
|
||||
<filterref filter='qemu-announce-self'/>
|
||||
</filter>
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
<filter name='no-ipv6-spoofing' chain='ipv6' priority='-600'>
|
||||
<rule action='drop' direction='out' priority='500'>
|
||||
<ipv6 match='no' srcipaddr='$IPV6'/>
|
||||
</rule>
|
||||
</filter>
|
||||
6
devenv/vagrant/etc/libvirt/pools/backups.xml
Normal file
6
devenv/vagrant/etc/libvirt/pools/backups.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<pool type='dir'>
|
||||
<name>backups</name>
|
||||
<target>
|
||||
<path>/mnt/backups</path>
|
||||
</target>
|
||||
</pool>
|
||||
6
devenv/vagrant/etc/libvirt/pools/images.xml
Normal file
6
devenv/vagrant/etc/libvirt/pools/images.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<pool type='dir'>
|
||||
<name>images</name>
|
||||
<target>
|
||||
<path>/var/lib/libvirt/images</path>
|
||||
</target>
|
||||
</pool>
|
||||
6
devenv/vagrant/etc/libvirt/pools/isos.xml
Normal file
6
devenv/vagrant/etc/libvirt/pools/isos.xml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
<pool type='dir'>
|
||||
<name>isos</name>
|
||||
<target>
|
||||
<path>/var/lib/libvirt/isos</path>
|
||||
</target>
|
||||
</pool>
|
||||
10
devenv/vagrant/etc/sysconfig/network-scripts/ifcfg-br-ext
Normal file
10
devenv/vagrant/etc/sysconfig/network-scripts/ifcfg-br-ext
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
DEVICE=br-ext
|
||||
TYPE=Bridge
|
||||
IPADDR=10.255.0.1
|
||||
PREFIX=16
|
||||
IPADDR1=169.254.169.254
|
||||
PREFIX1=16
|
||||
ONBOOT=yes
|
||||
BOOTPROTO=none
|
||||
NM_CONTROLLED=yes
|
||||
DELAY=0
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
DEVICE=br-int
|
||||
TYPE=Bridge
|
||||
ONBOOT=yes
|
||||
BOOTPROTO=none
|
||||
NM_CONTROLLED=no
|
||||
DELAY=0
|
||||
6
devenv/vagrant/etc/sysconfig/network-scripts/ifcfg-eth1
Normal file
6
devenv/vagrant/etc/sysconfig/network-scripts/ifcfg-eth1
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
DEVICE=eth1
|
||||
TYPE=Ethernet
|
||||
BOOTPROTO=none
|
||||
ONBOOT=yes
|
||||
NM_CONTROLLED=no
|
||||
BRIDGE=br-ext
|
||||
9
devenv/vagrant/etc/sysconfig/network-scripts/ifcfg-eth2
Normal file
9
devenv/vagrant/etc/sysconfig/network-scripts/ifcfg-eth2
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
DEVICE=eth2
|
||||
TYPE=Ethernet
|
||||
IPADDR=172.16.0.1
|
||||
PREFIX=16
|
||||
MTU=1600
|
||||
BOOTPROTO=none
|
||||
ONBOOT=yes
|
||||
NM_CONTROLLED=no
|
||||
BRIDGE=br-int
|
||||
7
devenv/vagrant/etc/sysctl.d/99-libvirt.conf
Normal file
7
devenv/vagrant/etc/sysctl.d/99-libvirt.conf
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
# Libvirt settings
|
||||
net.ipv4.ip_forward=1
|
||||
net.ipv4.conf.all.rp_filter=0
|
||||
net.ipv4.conf.default.rp_filter=0
|
||||
net.bridge.bridge-nf-call-arptables=1
|
||||
net.bridge.bridge-nf-call-iptables=1
|
||||
net.bridge.bridge-nf-call-ip6tables=1
|
||||
Loading…
Add table
Add a link
Reference in a new issue