No description
|
|
||
|---|---|---|
| base_data | ||
| data | ||
| lib | ||
| .gitignore | ||
| agent.sh | ||
| README.md | ||
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