Repository : ssh://git@open-mesh.org/doc
On branches: backup-redmine/2019-11-07,master
commit b435ef83d3cb7a12fd996a6244514645fa6bd2f8 Author: Sven Eckelmann sven@narfation.org Date: Sun Oct 13 21:27:52 2019 +0000
doc: open-mesh/Kernel_hacking_Debian_image: document way to connect simulated mesh with freifunk-gluon over vxlan
b435ef83d3cb7a12fd996a6244514645fa6bd2f8 open-mesh/Kernel_hacking_Debian_image.textile | 43 +++++++++++++++++++++++++++ open-mesh/hub-gluon.sh | 43 --------------------------- 2 files changed, 43 insertions(+), 43 deletions(-)
diff --git a/open-mesh/Kernel_hacking_Debian_image.textile b/open-mesh/Kernel_hacking_Debian_image.textile index 4febac8..861d1e3 100644 --- a/open-mesh/Kernel_hacking_Debian_image.textile +++ b/open-mesh/Kernel_hacking_Debian_image.textile @@ -388,6 +388,49 @@ ssh root@192.168.251.51 'tcpdump -i enp3s0 -s 0 -U -n -w - "port not 22"' > remo wireshark -k -i remote-dump </pre>
+h2. Connect to gluon VXLAN + +Gluon supports meshing over VXLAN. The gluon node just has to enable Mesh-on-WAN or Mesh-on-LAN and then it is possible to connect our virtual machine with the WAN/LAN port of the machine. Let us assume that the host running the Qemu instances is using interface <code>enp8s0</code> for this connection and that the qemu instances are all connected to bridge <code>br-qemu</code. + +The first information we have to get from from the gluon node is the VXLAN id. It can be queried on the gluon node via: <pre>lua -e 'print(tonumber(require("gluon.util").domain_seed_bytes("gluon-mesh-vxlan", 3), 16))'</pre> + +We must then create a vxlan interface on top of our normal ethernet interface, make sure that the ethernet interface is using a EUI64 based IPv6 link local address and insert the new interface in our bridge + +<pre> +#! /bin/sh + +BRIDGE=br-qemu +ETH=enp8s0 +VXLAN=vx_mesh_lan +# calculated on gluon node +VXLAN_ID=12094920 + +xor2() { + echo -n "${1:0:1}" + echo -n "${1:1:1}" | tr '0123456789abcdef' '23016745ab89efcd' +} + +interface_linklocal() { + local macaddr="$(cat /sys/class/net/"${ETH}"/address)" + local oldIFS="$IFS"; IFS=':'; set -- $macaddr; IFS="$oldIFS" + + echo "fe80::$(xor2 "$1")$2:$3ff:fe$4:$5$6" +} + +sudo ip addr add "$(interface_linklocal)"/64 dev "$ETH" +sudo ip link del "${VXLAN}" +sudo ip -6 link add "${VXLAN}" type vxlan \ + id "${VXLAN_ID}" \ + dstport 4789 \ + local "$(interface_linklocal)" \ + group ff02::15c \ + dev "${ETH}" \ + udp6zerocsumtx udp6zerocsumrx \ + ttl 1 + +sudo ip link set "${VXLAN}" up master "${BRIDGE}" +</pre> + h2. Using GDB
The instances are listening on 127.0.0.1 TCP port <code>23000 + instance_no</code>. We will use in the following example instance 1. The gdb debugger can be started from the linux source directory and all <code>lx-*</code> helpers will automatically be loaded. diff --git a/open-mesh/hub-gluon.sh b/open-mesh/hub-gluon.sh deleted file mode 100644 index 4bc00ee..0000000 --- a/open-mesh/hub-gluon.sh +++ /dev/null @@ -1,43 +0,0 @@ -#! /bin/sh -USER="$(whoami)" -BRIDGE=br0 -ETH=enp8s0 -VXLAN=vx_mesh_lan -# calculated on gluon node via: lua -lgluon.util -e 'print(tonumber(gluon.util.domain_seed_bytes("gluon-mesh-vxlan", 3), 16))' -VXLAN_ID=12094920 - - -xor2() { - echo -n "${1:0:1}" - echo -n "${1:1:1}" | tr '0123456789abcdef' '23016745ab89efcd' -} - -interface_linklocal() { - local macaddr="$(cat /sys/class/net/"${ETH}"/address)" - local oldIFS="$IFS"; IFS=':'; set -- $macaddr; IFS="$oldIFS" - - echo "fe80::$(xor2 "$1")$2:$3ff:fe$4:$5$6" -} - -sudo ip link add "${BRIDGE}" type bridge -for i in `seq 1 5`; do - sudo ip tuntap add dev tap$i mode tap user "$USER" - sudo ip link set tap$i up - sudo ip link set tap$i master "${BRIDGE}" -done - -sudo ip link set "${BRIDGE}" up - -sudo ip addr add "$(interface_linklocal)"/64 dev "$ETH" -sudo ip link del "${VXLAN}" -sudo ip -6 link add "${VXLAN}" type vxlan \ - id "${VXLAN_ID}" \ - dstport 4789 \ - local "$(interface_linklocal)" \ - group ff02::15c \ - dev "${ETH}" \ - udp6zerocsumtx udp6zerocsumrx \ - ttl 1 - -sudo ip link set "${VXLAN}" up master "${BRIDGE}" -sudo ip addr replace 192.168.2.1/24 dev "${BRIDGE}"