No description
Find a file
GnomeZworc 11eef332b7
add numbers gestion function
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
2025-05-10 11:47:46 +02: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
lib add numbers gestion function 2025-05-10 11:47:46 +02:00
.gitignore add gitignore 2025-05-04 13:55:02 +02:00
agent.sh add volume gestion 2025-05-10 09:47:22 +02:00
README.md add dhcp 2025-05-09 21:35:38 +02:00

Two

this project is Two with bash on first move

Prepare kvm

apt-get install -y \
  vim \
  htop \
  socat \
  ebtables \                          # filtre arp
  qemu-system qemu-utils qemu-kvm \   # qemu install
  genisoimage \                       # cloud-init file
  curl \
  whois \
  tcpdump \
  bridge-utils                        # bridge add
iv
ebtables -D FORWARD -p arp --arp-op Request --arp-ip-dst 240.0.0.1 -j DROP
ebtables -A FORWARD -p arp --arp-op Request --arp-ip-dst 240.0.0.1 -j DROP
ebtables -L --Lc

genisoimage -output seed.iso -volid cidata -joliet -rock meta-data user-data network-config

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