Closed Sven-Niehus closed 6 years ago
Most DHCP servers can integrate to a DNS and make local hostname lookup work - why wouldn't this work in this case?
May be problem is, that your container is not attached to the network (the Containers is empty in the network inspect, I expect that you have done it after the container was created). You need to use --network=ext_wifi (may be the --net=ext_wifi is not recognized correctly?) when creating the container. And in this case you do not need to use --publish parameters, because the ports will be available directly.
@freddydk the dhcp server is configured to accept secure and insecure updates, but I somehow can't resolve the hostname of the container.
@kine the container is attached to the network. I've also already removed the --publish parameters. My network ext_wifi is an virtual switch that I created in the Hyper-V-Manager. Maybe this is a problem?
Here is the configuration after the interface gets an DHCP lease
Configuration for interface "Ethernet 2"
DHCP enabled: Yes
IP Address: 192.168.192.13
Subnet Prefix: 192.168.192.0/24 (mask 255.255.255.0)
Default Gateway: 192.168.192.254
Gateway Metric: 0
InterfaceMetric: 25
DNS servers configured through DHCP: 192.168.192.66
192.168.192.56
192.168.192.44
Register with which suffix: Primary only
WINS servers configured through DHCP: None
Yeah, I don't think you are looking for getting a computer (or container) without a name to work - you need to figure out how to get name resolution to work. Maybe the missing WINS configuration is part of the issue?
Is the 192.168.192.xxx the expected network, on which your computer and others are? I want to make sure that you are really getting the address from DHCP server you expect, and not from the internal DHCP server of the docker or hyper-v or something...
@kine yes that is the correct network.
@freddydk I don't think so. WINS is not being used anywhere in our network so it should not be a problem for Docker
I am using docker running as virtual on VMWare without issue like that. I have created the network through
docker network create tlan -d transparent
I only needed to enable promiscuous mode on the VMWare switch. For Hyper-V switch you need to use
address spoofing through
Get-VMNetworkAdapter -VMName <name of vm that is your container host> | set-VMNetworkAdapter -MacAddressSpoofing On
(taken from https://social.msdn.microsoft.com/Forums/en-US/b09266b0-ac4e-424f-8757-c34547c4adb1/unable-to-ping-containers-created-with-transparent-network-from-other-hosts?forum=windowscontainers)
Until than the network communication is not ok and could lead to some issues. But it is just guess...
I fixed the Issue by activating dynamic updates for the segment and IPv4 itself on the DHCP Server.
Beforehand it was only enabled for the DHCP segment and not IPv4 which should have worked but did not.
Hi,
is it possible to create a Container without a hostname that can be accessed directly via its IP?
I'm creating new containers with the following command:
docker inspect of a running container:
log of a newly created container:
The containers ipconfig:
I want to use a transparent network as the containers network so that it can get its own IP via our DHCP server.
My networks:
inspect of ext_wifi:
The problem now is that I can access the containers IP, but the hostname that I set will not resolve due to that our DNS server does not know the container and so the Windows Client and as well C/SIDE won't work on any Client. Is it also not possible to set the hostname to the IP that the container has (because it will be assigned via DHCP)