Created
February 23, 2025 01:42
-
-
Save BitesizedLion/4dd9c0ba0ffcdd1c4274871289936831 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create and configure the tap interface | |
sudo ip tuntap add dev fc-88-tap0 mode tap | |
sudo ip addr add 169.254.0.22/30 dev fc-88-tap0 | |
sudo ip link set fc-88-tap0 up | |
# Set up iptables rules | |
sudo iptables -A FORWARD -i fc-88-tap0 -o enp1s0 -j ACCEPT | |
sudo iptables -A FORWARD -i enp1s0 -o fc-88-tap0 -m state --state RELATED,ESTABLISHED -j ACCEPT | |
sudo iptables -t nat -A POSTROUTING -o enp1s0 -j MASQUERADE | |
# Enable IP forwarding | |
sudo sysctl -w net.ipv4.ip_forward=1 | |
echo "net.ipv4.ip_forward=1" | sudo tee -a /etc/sysctl.conf | |
# Run VM | |
firectl --kernel=hello-vmlinux.bin --root-drive=hello-rootfs.ext4 --tap-device=fc-88-tap0/02:FC:00:00:00:05 --kernel-opts="console=ttyS0 noapic reboot=k panic=1 pci=off nomodules rw ip=169.254.0.21::169.254.0.22:255.255.255.252::eth0:off" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment