No description
Find a file
GnomeZworc ecf9298fc9
update local.sh data
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-12-07 19:54:33 +01:00
base_data add local frr to border routeur 2025-05-04 13:34:41 +02:00
data add gitignore 2025-05-04 13:55:02 +02:00
files fix error in config 2025-05-15 21:40:24 +02:00
lib fix nat 2025-05-24 14:43:03 +02:00
.gitignore add gitignore 2025-05-04 13:55:02 +02:00
agent.sh move config 2025-05-16 14:02:04 +02:00
local.sh update local.sh data 2025-12-07 19:54:33 +01:00
README.md make public ip infra 2025-05-19 18:47:13 +02:00

Two

this project is Two with bash on first move

Prepare kvm

package usage:

  • ebtables / filtre arp
  • socat / socket interaction
  • qemu-system qemu-utils qemu-kvm / qemu install
  • curl / use lib
  • tcpdump / debug network
  • bridge-utils / bridge add

Command et info utile

ebtables -L --Lc

socat -,raw,echo=0 unix-connect:/tmp/vm-monitor.sock
root@lab1:~/vm# cat /etc/systemd/system/dnsmasq@.service
[Unit]
Description=dnsmasq in netns %i
After=network.target

[Service]
Type=simple
ExecStart=/usr/local/bin/run-dnsmasq-in-netns.sh %i
ExecStopPost=/bin/rm -f /run/dnsmasq-%i.pid

[Install]
WantedBy=multi-user.target
#!/bin/bash
set -e

# Expects one argument: netns_bridge (e.g. vpc-00003_br-00002 or vpc1_br0)
arg="$1"
NETNS="${arg%%_*}"
BRIDGE="${arg#*_}"

echo "start ${NETNS} ${BRIDGE}"

exec ip netns exec "$NETNS" \
  dnsmasq \
    --no-daemon \
    --interface="$BRIDGE" \
    --bind-interfaces \
    --pid-file="/run/dnsmasq-$arg.pid" \
    --conf-file="/etc/dnsmasq.d/$arg.conf" \
    --no-hosts \
    --no-resolv \
    --log-facility="/var/log/dnsmasq-$arg.log" \
    --no-daemon -p0
vm-1-toto:~# cat /etc/cloud/cloud.cfg.d/20_user.cfg
system_info:
  default_user:
    name: syonad
vm-1-toto:~# cat /etc/cloud/cloud.cfg.d/99_metadata.cfg
datasource_list: [ NoCloud ]
datasource:
  NoCloud:
    seedfrom: 'http://169.254.169.254:80'
    timeout: 5
    max_wait: 10
qemu-system-x86_64 -enable-kvm -cpu host -m 512 \
  -smp 1 -serial unix:/tmp/i-0343234.sock,server,nowait \
  -monitor unix:/tmp/i-0343234.mon-sock,server,nowait \
  -qmp unix:/tmp/i-0343234.qmp-sock,server,nowait \
  -drive file=/disk/vm-1.qcow2,if=virtio \
  -netdev tap,id=net0,ifname=tap6327775173,script=no,downscript=no -device virtio-net-pci,netdev=net0,mac=00:22:33:00:00:0A \
  -display none -daemonize
qemu-system-x86_64 -enable-kvm -cpu host -m 512 \
  -smp 1 -serial unix:/tmp/i-0343234.sock,server,nowait \
  -monitor unix:/tmp/i-0343234.mon-sock,server,nowait \
  -qmp unix:/tmp/i-0343234.qmp-sock,server,nowait \
  -drive file=/disk/vm-2.qcow2,if=virtio \
  -drive file=/disk/tmp.qcow2,if=virtio \
  -drive file=/disk/root.qcow2,if=virtio \
  -netdev tap,id=net0,ifname=tap9102959250,script=no,downscript=no -device virtio-net-pci,netdev=net0,mac=00:22:33:00:00:0A \
  -display none -daemonize \
  -drive file=./seed/seed.iso,media=cdrom,if=ide