diff options
| author | Arslaan Pathan <[email protected]> | 2026-09-13 08:52:46 +1200 |
|---|---|---|
| committer | Arslaan Pathan <[email protected]> | 2026-09-13 08:52:46 +1200 |
| commit | 970037e98be448f41829855a18933b3de2f7a497 (patch) | |
| tree | 1276815778aab03fc621216cc81bb23a1235b910 /qemu-ifup | |
| parent | 867d71725a5ef131059ed2d31320630fea8c1e47 (diff) | |
| download | yerbalinux-970037e98be448f41829855a18933b3de2f7a497.tar.xz yerbalinux-970037e98be448f41829855a18933b3de2f7a497.zip | |
tbfr w/u i dont know whats even in this commit anymore but.. try add networking properly ig\?
Diffstat (limited to 'qemu-ifup')
| -rwxr-xr-x | qemu-ifup | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/qemu-ifup b/qemu-ifup new file mode 100755 index 0000000..7b7f70c --- /dev/null +++ b/qemu-ifup @@ -0,0 +1,23 @@ +#!/bin/sh +# script to configure QEMU tap device + +ip link set "$1" up +ip addr add 192.168.7.1/24 dev "$1" 2>/dev/null + +sysctl -w net.ipv4.ip_forward=1 + +DEFAULT_IFACE="$(ip route show default 0.0.0.0/0 | awk '{print $5}')" + +iptables -D FORWARD -s 192.168.7.0/24 -j ACCEPT 2>/dev/null +iptables -D FORWARD -d 192.168.7.0/24 -j ACCEPT 2>/dev/null +iptables -D DOCKER-USER -s 192.168.7.0/24 -j ACCEPT 2>/dev/null +iptables -D DOCKER-USER -d 192.168.7.0/24 -j ACCEPT 2>/dev/null + +iptables -I FORWARD 1 -s 192.168.7.0/24 -j ACCEPT +iptables -I FORWARD 1 -d 192.168.7.0/24 -j ACCEPT + +iptables -I DOCKER-USER 1 -s 192.168.7.0/24 -j ACCEPT 2>/dev/null +iptables -I DOCKER-USER 1 -d 192.168.7.0/24 -j ACCEPT 2>/dev/null + +iptables -t nat -D POSTROUTING -s 192.168.7.0/24 -o "$DEFAULT_IFACE" -j MASQUERADE 2>/dev/null +iptables -t nat -I POSTROUTING 1 -s 192.168.7.0/24 -o "$DEFAULT_IFACE" -j MASQUERADE |
