summaryrefslogtreecommitdiffstats
path: root/content/posts/archlinux-and-bridged-libvirt-plus-ufw.rst
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2014-12-12 13:59:09 +0100
committermakefu <github@syntax-fehler.de>2014-12-12 13:59:09 +0100
commitfb6b7311b4f94467d397a8804b4b67eaeecc91b9 (patch)
treed9ff38cb1d897b612264eab646a1ad2254cec124 /content/posts/archlinux-and-bridged-libvirt-plus-ufw.rst
parent0a6f59e08857c99b087bfc2c5ba0229204598e55 (diff)
parent99f7895cdd4cbf99b1d9c768301e5d69e28f5fde (diff)
Merge branch 'master' of pigstarter:euer_blog
Diffstat (limited to 'content/posts/archlinux-and-bridged-libvirt-plus-ufw.rst')
-rw-r--r--content/posts/archlinux-and-bridged-libvirt-plus-ufw.rst68
1 files changed, 68 insertions, 0 deletions
diff --git a/content/posts/archlinux-and-bridged-libvirt-plus-ufw.rst b/content/posts/archlinux-and-bridged-libvirt-plus-ufw.rst
new file mode 100644
index 0000000..cb4850d
--- /dev/null
+++ b/content/posts/archlinux-and-bridged-libvirt-plus-ufw.rst
@@ -0,0 +1,68 @@
+Arch+libvirt+bridges+ufw
+########################
+:date: 2014-07-03 14:48
+:tags: archlinux,libvirt,network-bridge,ufw,netctl
+
+I never thought getting bridged network for libvirt
+clients to work under archlinux. Here is the digest.
+
+Adding Bridge Network with netctl
+---------------------------------
+eth0 needs to be up in order to get the bridge working
+
+
+**/etc/netctl/bridge**
+
+.. code-block:: bash
+
+ Description='bridge'
+ Interface=br0
+ Connection=bridge
+ BindsToInterface=(eth0)
+ IP=static # or dhcp
+ Address=('1.2.3.4/24')
+ Gateway='1.2.3.1'
+ DNS=('1.2.3.3')
+ ExecUpPost="brctl stp $Interface on||:"
+
+**/etc/netctl/eth_bridged**
+
+.. code-block:: bash
+
+ Description='eth0 without ip'
+ Interface=eth0
+ Connection=ethernet
+ IP=no
+ IP6=no
+
+**enable the bridge**
+
+.. code-block:: bash
+
+ systemctl disable dhcpcd@eth0 # if applicable
+ netctl enable bridge
+ netctl enable eth_bridged
+
+After a reboot the interface should be available and libvirt should be able to use the bridge for libvirt clients.
+If you have ufw in place, add this line to **/etc/ufw/before{,6}.rules** between \*filter and COMMIT :
+
+.. code-block:: bash
+
+ -I FORWARD -m physdev --physdev-is-bridged -j ACCEPT
+
+maybe you also need the following lines in **/etc/sysctl.d/bridge.conf**:
+
+.. code-block:: bash
+
+ net.bridge.bridge-nf-call-ip6tables = 0
+ net.bridge.bridge-nf-call-iptables = 0
+ net.bridge.bridge-nf-call-arptables = 0
+
+enable security changes
+
+.. code-block:: bash
+
+ ufw disable
+ ufw enable
+ sysctl -p /etc/sysctl.d/bridge.conf
+