Docker didn't update arp table
Hi, I am new to docker, so this is new to me.
I am trying to port an app of my own to run in docker. My app do an auto-discovery on the network to automatically identify target devices on the network. I use "nmap -v0 -sn <ip/cidr>" and the new founded hosts are added to arp table. Next, I search the arp table by opening /proc/net/arp and parse the lines looking for target mac addresses. This works in the standalone app, but not when in the docker. Looks like the docker start with a copy of host arp table and it is immutable, I mean, pinging a host inside the docker environment, did not change the arp table. I got this conclusion by running my docker as "docker run -it --network host miguel/tst bash" and found the arp table (ip neig) already populated with the same content than the host. Also, running nmap -sn did not add new entries to the arp table. How can I run a docker app that scans the same host network ? |
docker uses a virtual network, but it actually depends on how is it configured.
https://docs.docker.com/network/ I guess you need the "host network". |
Quote:
|
Please bear in mind that containers present an entirely synthetic version of the world to their clients. This includes "network resources." Clients can use these possibly-imaginary resources, but they cannot manipulate them. "Pay no attention to the little man behind the curtain ... which curtain you cannot see."
Everything(!) about containers is "a carefully-prepared and fully-functional ... illusion." |
All times are GMT -5. The time now is 09:08 PM. |