Giter Site home page Giter Site logo

pxe's Introduction

This container is used by spam4kev/razor-server as a PXE/TFTP/DCHP server and is expected to be built using docker-compose.

  • How to Build

Becuase tftp returns traffic over a random ephimeral port after first client connection on port 69, a special network mode using the hosts interface as the containers interface must be used. This can be done using 'docker run --net=host <other options> <image name>'.

  • iPXE boot using dnsmasq
dnsmasq  \
        --dhcp-match=IPXEBOOT,175 \
          # 175 sets a variable to the value before the comma. In this case, the variable is IPXEBOOT
        --dhcp-boot=net:IPXEBOOT,bootstrap.ipxe \
          # This sets dhcp-boot option equal to whatever is after the comma if the variable to the
          # right of the colon is set. Since our previous statement sets IPXEBOOT, the dhcp-boot gets
          # a value of bootstrap.ipxe
        --dhcp-boot=undionly.kpxe \
          # this sets dhcp-boot to what is on the right of the equal sign. This will be applied at first tftpboot
          # because within the undionly.kpxe it says to boot the net option
        --enable-tftp \
	  # turns on tftp service in dnsmasq
        --tftp-root=/tftpboot \
	  # sets the directory that iPXE clients will pull from. in our scripts, we put bootstrap.ipxe & 
	  # undionly.kpxe in /tftpboot on image startup.
        --log-dhcp \
	  # help with troubleshooting any problems
        --dhcp-range=10.11.11.1,proxy \
	  # when proxy is listed to the right of the comma, the server differs all iPXE clients toe the 
	  # ip set before the comma.
        --no-daemon
	  # needed so docker container stays running(?)
  • troubleshooting
docker run -ti -p 53:53/udp -p 53:53 -p 67:67 -p 68:68/udp -p 69:69 -p 69:69/udp -p 4011:4011/udp --net=host centos sh
#on docker host based on https://goldmann.pl/blog/2014/01/21/connecting-docker-containers-on-multiple-hosts/
sudo sh -c 'echo 1 > /proc/sys/net/ipv4/conf/docker0/arp_accept'
sudo sh -c 'echo 1 > /proc/sys/net/ipv4/conf/enp0s3/arp_accept'
#or
sudo sysctl net.ipv4.conf.enp0s3.proxy_arp=1 
sudo sysctl net.ipv4.conf.docker0.proxy_arp=1
sudo sysctl net.ipv4.ip_forward=1
sudo sysctl net.ipv4.conf.all.forwarding=1	#allowed all interfaces to forward traffic if exposed in dockerfile

pxe's People

Contributors

spam4kev avatar jpetazzo avatar avlis avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.