FROM --platform=linux/amd64 alpine:3.19 LABEL maintainer="GNS3 User" LABEL description="Lightweight Linux appliance for GNS3 with VLAN and IP forwarding support" # Install essential network tools RUN apk add --no-cache \ bash \ iproute2 \ iptables \ tcpdump \ dhclient \ bridge-utils # Load VLAN module (8021q) at boot RUN echo "8021q" >> /etc/modules # Create startup script to enable VLAN and IP forwarding RUN cat > /usr/local/bin/startup.sh <<'EOF' #!/bin/bash # Load VLAN module modprobe 8021q 2>/dev/null # Enable IP forwarding sysctl -w net.ipv4.ip_forward=1 >/dev/null 2>&1 sysctl -w net.ipv6.conf.all.forwarding=1 >/dev/null 2>&1 # Bring up all network interfaces for iface in /sys/class/net/*; do ifname=$(basename $iface) if [ "$ifname" != "lo" ]; then ip link set $ifname up fi done # Start shell exec /bin/bash EOF RUN chmod +x /usr/local/bin/startup.sh WORKDIR /root CMD ["/usr/local/bin/startup.sh"]