add dhcp
Signed-off-by: GnomeZworc <nicolas.boufidjeline@g3e.fr>
This commit is contained in:
parent
461f72678f
commit
8fcfefc900
3 changed files with 143 additions and 2 deletions
41
README.md
41
README.md
|
|
@ -21,7 +21,7 @@ apt-get install -y \
|
|||
|
||||
|
||||
```
|
||||
ebtables -L --Lc
|
||||
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
|
||||
|
|
@ -29,4 +29,43 @@ 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
|
||||
```
|
||||
Loading…
Add table
Add a link
Reference in a new issue