How can I deploy my custom dhcp server on docker?

Patrick

So I code my own custom dhcp server for specific job and I want to deploy it using docker. I need to expose it on port 67/udp and use network_mode host. I tried configuring my docker-compose like this.

version: '3'

services:
  dhcp:
    container_name: custom_dhcp_server
    image: registry.patty.com/custom_dhcp_server:latest
    restart: always
    command: python3 -u src/dhcp_server.py
    ports: 
      - "67:67/udp"
    network_mode: "host"

but I just found that I can't expose port with network_mode host. So how can I deploy it using docker.

larsks

but I just found that I can't expose port with network_mode host.

While that's true, it's because it's unnecessary. When you're running in the host network namespace, you don't need to use port mapping because whatever port you listen on is a host port. As long as your custom DHCP server is listening for UDP traffic on port 67, you're all set.

If things don't appear to be working, there are a number of diagnostic steps you can try.

  • What happens if you run a non-custom dhcp server? dnsmasq is good for this because it's relatively simple to configure.

  • Add debugging code to your custom dhcp server. Is it receiving any requests?

  • Check your firewall; any chance you're blocking the dhcp requests?

Etc.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How can I find my DHCP server?

How can I find my DHCP nameservers?

Can i deploy my .war on an nginx server

How can I deploy my meteor app to an Ubuntu server in my local network?

How can I deploy a local server easily?

How can I know the DHCP settings offered by a server?

How to deploy my app inside docker to ubuntu server

How can I expose my tomcat server outside of my docker container running on my local machine?

How to update my app when I deploy it using docker

I need help configuring my DHCP server

How can I write and deploy a custom authentication package in windows?

How can I deploy spark artifacts to a custom maven repository?

Can I configure my Windows 10 PC as a DHCP server on a local switch?

how can i do for an MDB to deploy last on my wildfly

How can I deploy an ingress controller for my Kubernetes cluster

How can I deploy my Angular 2 + Typescript + Webpack app

How can I deploy my windows phone 8.1 app?

how can i deploy the jar file in remote server

How can I deploy a local SQL Server database for a Winforms app

How can I add a custom column to my Serilog MS SQL Server sink?

how can I save docker's database data locally on my server?

How do I set up an Ubuntu server to be the router for two private networks on my network, and do the DHCP addressing?

Can a dhcp client select its server? How?

How can I be sure that my server is not virtualised?

How do I install and configure a DHCP server?

How can I convert my custom classes into a custom framework in iOS?

How can I find any additional DHCP servers that may have been installled on my network by an intruder?

How to deploy a custom docker image on Elastic Beanstalk?

How can I cast my NSURLSessionDownloadTask to my custom NSURLSessionDownloadTask (inheritance)?

TOP Ranking

HotTag

Archive