GNS3 Docker Images
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

35 lines
1.0 KiB

  1. # ethloop - virtual RJ45 loopback plug
  2. FROM debian:buster-slim
  3. COPY ethloop.c /root/
  4. RUN set -e -x \
  5. && export DEBIAN_FRONTEND=noninteractive \
  6. && apt-get update \
  7. && apt-get -y upgrade \
  8. && apt-get -y --no-install-recommends install \
  9. libpcap0.8 net-tools \
  10. && dpkg-query -f '${binary:Package}\n' -W | sort > /tmp/base_packages \
  11. && apt-get -y --no-install-recommends install \
  12. gcc libc6-dev libpcap0.8-dev \
  13. && gcc -Wall -O2 -s -o /usr/local/bin/ethloop /root/ethloop.c -lpcap \
  14. && dpkg-query -f '${binary:Package}\n' -W | sort > /tmp/packages \
  15. && comm -13 /tmp/base_packages /tmp/packages | xargs apt-get -y purge \
  16. && rm -f /tmp/base_packages /tmp/packages \
  17. && rm -rf /var/lib/apt/lists/* \
  18. #
  19. # startup script
  20. #
  21. && printf '\
  22. \043!/bin/sh\n\
  23. \043 on eth0 disable IPv6, set MTU to 9000\n\
  24. ifconfig eth0 down\n\
  25. echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6\n\
  26. ifconfig eth0 mtu 9000 up\n\
  27. \n\
  28. exec ethloop eth0\n' \
  29. > /etc/init.sh && chmod +x /etc/init.sh
  30. CMD [ "/etc/init.sh" ]