LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Containers
User Name
Password
Linux - Containers This forum is for the discussion of all topics relating to Linux containers. Docker, LXC, LXD, runC, containerd, CoreOS, Kubernetes, Mesos, rkt, and all other Linux container platforms are welcome.

Notices


Reply
  Search this Thread
Old 06-14-2022, 09:40 AM   #1
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499
Blog Entries: 2

Rep: Reputation: 68
Question 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 ?
 
Old 06-14-2022, 11:01 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,897

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
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".
 
Old 06-14-2022, 11:46 AM   #3
marozsas
Senior Member
 
Registered: Dec 2005
Location: Campinas/SP - Brazil
Distribution: SuSE, RHEL, Fedora, Ubuntu
Posts: 1,499

Original Poster
Blog Entries: 2

Rep: Reputation: 68
Quote:
Originally Posted by pan64 View Post
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".
Yes, I already use it as you can see in the original post when I wrote '...running my docker as "docker run -it --network host miguel/tst bash" '
 
Old 06-14-2022, 08:31 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,665
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
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."

Last edited by sundialsvcs; 06-14-2022 at 08:32 PM.
 
  


Reply

Tags
arp, docker, nmap



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: How to Work with Tables (Select, Update, Delete, Create Table, Alter Table, Drop Table) in MySQL LXer Syndicated Linux News 0 02-13-2021 12:10 AM
Strange ARP behavior : A linux server responds to all ARP requests Hdvd21 Linux - Networking 4 10-24-2013 05:02 AM
ARP table or routing table consulted first? YaMaHaBoB Linux - Networking 4 07-15-2011 04:56 PM
Disabling ARP probes after receiving an ARP request AltecLansingMan Linux - Networking 1 03-30-2004 01:25 PM
How to create an proxyarp entry in arp table by using arp command? himalayas Linux - Networking 0 06-04-2003 04:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Containers

All times are GMT -5. The time now is 09:43 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration