• 0 Posts
  • 1 Comment
Joined 1 year ago
cake
Cake day: October 19th, 2023

help-circle
  • You should be able to reach local network running in bridge mode, here’s a test from my local server pinging the laptop, executed in a docker container

    root@dalek:/# ping -c1  192.168.8.167  
    PING 192.168.8.167 (192.168.8.167): 56 data bytes  
    64 bytes from 192.168.8.167: seq=0 ttl=64 time=0.440 ms  
    \--- 192.168.8.167 ping statistics ---  
    1 packets transmitted, 1 packets received, 0% packet loss  
    round-trip min/avg/max = 0.440/0.440/0.440 ms  
    root@dalek:/# ip route get 192.168.8.167  
    192.168.8.167 dev eno1  src 192.168.8.136
    
    

    Host mode exposes the listening ports of the container as they were services on the machine, so iptables doesn’t do any mangling of traffic where to send connection to port XY to which container.