Docker cannot access the host's network

SitQ80

Dabbler
Joined
Nov 3, 2021
Messages
15
Version : TrueNAS-SCALE-22.02-RC.1-1

My truenas IP is 192.168.1.10

In truenas, I created a docker container, used Add external Interface and DHCP automatically obtained an ip: 192.168.1.22

in docker container, I ping any internal network device is normal, except the host computer. My ping 192.168.1.10 is timed out.

Why docker container cannot access the host's network
 

SitQ80

Dabbler
Joined
Nov 3, 2021
Messages
15
ifconfig
Code:
eth0      Link encap:Ethernet
          inet addr:172.16.0.60  Bcast:172.16.255.255  Mask:255.255.0.0


lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0


net1      Link encap:Ethernet 
          inet addr:192.168.2.22  Bcast:192.168.2.255  Mask:255.255.255.0


tun0      Link encap:UNSPEC 
          inet addr:10.0.0.1  P-t-P:10.0.0.2  Mask:255.255.255.255


Code:
bash-5.0# ping 172.16.0.1
PING 172.16.0.1 (172.16.0.1): 56 data bytes
64 bytes from 172.16.0.1: seq=0 ttl=64 time=0.158 ms
64 bytes from 172.16.0.1: seq=1 ttl=64 time=0.165 ms
64 bytes from 172.16.0.1: seq=2 ttl=64 time=0.168 ms
64 bytes from 172.16.0.1: seq=3 ttl=64 time=0.175 ms
^C
--- 172.16.0.1 ping statistics ---
4 packets transmitted, 4 packets received, 0% packet loss
round-trip min/avg/max = 0.158/0.166/0.175 ms
bash-5.0# ping 192.168.2.10
PING 192.168.2.10 (192.168.2.10): 56 data bytes
^C
--- 192.168.2.10 ping statistics ---
8 packets transmitted, 0 packets received, 100% packet loss



ping other devices 192.168.2.1 & 192.168.2.5 is normal.
 

SitQ80

Dabbler
Joined
Nov 3, 2021
Messages
15
Because I use an openvpn docker image(kylemanna/openvpn), I am very troubled by the problems I am facing now. I connect to openvpn and can only use all devices except truenas devices.
 

SitQ80

Dabbler
Joined
Nov 3, 2021
Messages
15
tcpdump

IP 192.168.2.5 > 192.168.2.22: ICMP echo reply, id 29184, seq 0, length 64
IP 192.168.2.22 > 192.168.2.5: ICMP echo request, id 29184, seq 1, length 64
IP 192.168.2.5 > 192.168.2.22: ICMP echo reply, id 29184, seq 1, length 64

IP 192.168.2.22 > 192.168.2.22: ICMP host 192.168.2.10 unreachable, length 92
IP 192.168.2.22 > 192.168.2.22: ICMP host 192.168.2.10 unreachable, length 92
 

SitQ80

Dabbler
Joined
Nov 3, 2021
Messages
15
You can try to use the nginx docker image to TEST MY QUESTION, then install the iputils-ping package, try to ping your host.

You will find that you cannot ping the host
 

Kieros

Explorer
Joined
Jan 13, 2022
Messages
50
Welcome to truenas forum where so many questions remain unanswered.
Did you ever solve this problem. I have the same issue
 
Top