LXC Container on same network as host with internet access

Sorry for the previous reply, I wasn’t aware of the tcpdump usage and I did some reading and ran the following diagnostic commands:

Device IP
Container 192.168.0.185
Ubuntu VM 192.168.0.161
Ubuntu Host 192.168.0.166
Windows‎‎‎‎ 192.168.0.117
Router 192.168.0.1
ajinkya@metaverse:~$ sudo tcpdump src 192.168.0.185
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on br0, link-type EN10MB (Ethernet), capture size 262144 bytes

1. Ping Ubuntu VM from container:

root@con1:/# ping -c 4 192.168.0.161
PING 192.168.0.161 (192.168.0.161) 56(84) bytes of data.
64 bytes from 192.168.0.161: icmp_seq=1 ttl=64 time=0.136 ms
64 bytes from 192.168.0.161: icmp_seq=2 ttl=64 time=0.137 ms
64 bytes from 192.168.0.161: icmp_seq=3 ttl=64 time=0.140 ms
64 bytes from 192.168.0.161: icmp_seq=4 ttl=64 time=0.135 ms

--- 192.168.0.161 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3079ms
rtt min/avg/max/mdev = 0.135/0.137/0.140/0.002 ms
Corresponding tcpdump:
15:45:06.789224 IP 192.168.0.185 > metaverse: ICMP echo request, id 499, seq 1, length 64
15:45:07.824442 IP 192.168.0.185 > metaverse: ICMP echo request, id 499, seq 2, length 64
15:45:08.844715 IP 192.168.0.185 > metaverse: ICMP echo request, id 499, seq 3, length 64
15:45:09.868664 IP 192.168.0.185 > metaverse: ICMP echo request, id 499, seq 4, length 64
15:45:12.044572 ARP, Reply 192.168.0.185 is-at 00:16:3e:67:d1:4e (oui Unknown), length 28

2. Ping Ubuntu host from container:

root@con1:/# ping -c 4 192.168.0.166
PING 192.168.0.166 (192.168.0.166) 56(84) bytes of data.
64 bytes from 192.168.0.166: icmp_seq=1 ttl=64 time=0.480 ms
64 bytes from 192.168.0.166: icmp_seq=2 ttl=64 time=0.569 ms
64 bytes from 192.168.0.166: icmp_seq=3 ttl=64 time=0.214 ms
64 bytes from 192.168.0.166: icmp_seq=4 ttl=64 time=0.330 ms

--- 192.168.0.166 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3022ms
rtt min/avg/max/mdev = 0.214/0.398/0.569/0.137 ms
Corresponding tcpdump:
15:47:18.000937 IP 192.168.0.185 > ubuntu: ICMP echo request, id 503, seq 1, length 64
15:47:19.002322 IP 192.168.0.185 > ubuntu: ICMP echo request, id 503, seq 2, length 64
15:47:20.003253 IP 192.168.0.185 > ubuntu: ICMP echo request, id 503, seq 3, length 64
15:47:21.023294 IP 192.168.0.185 > ubuntu: ICMP echo request, id 503, seq 4, length 64
15:47:23.056436 ARP, Reply 192.168.0.185 is-at 00:16:3e:67:d1:4e (oui Unknown), length 28

3. Ping Windows from container:

root@con1:/# ping -c 4 192.168.0.117
PING 192.168.0.117 (192.168.0.117) 56(84) bytes of data.
From 192.168.0.185 icmp_seq=1 Destination Host Unreachable
From 192.168.0.185 icmp_seq=2 Destination Host Unreachable
From 192.168.0.185 icmp_seq=3 Destination Host Unreachable
From 192.168.0.185 icmp_seq=4 Destination Host Unreachable

--- 192.168.0.117 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3052ms
pipe 4
Corresponding tcpdump:
15:52:32.046894 ARP, Request who-has DESKTOP-51OS6J2 tell 192.168.0.185, length 28
15:52:33.050544 ARP, Request who-has DESKTOP-51OS6J2 tell 192.168.0.185, length 28
15:52:34.074708 ARP, Request who-has DESKTOP-51OS6J2 tell 192.168.0.185, length 28

4. Ping router from container:

root@con1:/# ping -c 4 192.168.0.1
PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data.

--- 192.168.0.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3051ms
Corresponding tcpdump:
16:07:00.032587 IP 192.168.0.185 > dlinkrouter: ICMP echo request, id 510, seq 1, length 64
16:07:00.053363 ARP, Reply 192.168.0.185 is-at 00:16:3e:67:d1:4e (oui Unknown), length 28
16:07:01.040066 IP 192.168.0.185 > dlinkrouter: ICMP echo request, id 510, seq 2, length 64
16:07:02.064054 IP 192.168.0.185 > dlinkrouter: ICMP echo request, id 510, seq 3, length 64
16:07:03.084129 IP 192.168.0.185 > dlinkrouter: ICMP echo request, id 510, seq 4, length 64
16:07:05.132164 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
16:07:06.156233 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
16:07:07.183942 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28

5. Ping google.com from container:

root@con1:/# ping google.com
ping: unknown host google.com
Corresponding tcpdump:
15:54:16.158231 IP 192.168.0.185.57213 > dlinkrouter.domain: 18560+ A? google.com. (28)
15:54:16.213271 ARP, Reply 192.168.0.185 is-at 00:16:3e:67:d1:4e (oui Unknown), length 28
15:54:21.161966 IP 192.168.0.185.50985 > dns.google.domain: 18560+ A? google.com. (28)
15:54:21.256921 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:22.280819 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:23.304779 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:24.165754 IP 192.168.0.185.58761 > dns.google.domain: 18560+ A? google.com. (28)
15:54:30.169073 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:30.369846 IP 192.168.0.185.57213 > dlinkrouter.domain: 18560+ A? google.com. (28)
15:54:35.173435 IP 192.168.0.185.50985 > dns.google.domain: 18560+ A? google.com. (28)
15:54:35.593548 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:36.616926 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:37.640893 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:38.176410 IP 192.168.0.185.58761 > dns.google.domain: 18560+ A? google.com. (28)
15:54:44.182361 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:45.192864 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:45.933473 IP 192.168.0.185.56999 > dlinkrouter.domain: 12607+ A? google.com. (28)
15:54:49.661170 IP 192.168.0.185.47018 > dns.google.domain: 12607+ A? google.com. (28)
15:54:51.170325 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:52.194001 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:52.663172 IP 192.168.0.185.50867 > dns.google.domain: 12607+ A? google.com. (28)
15:54:53.218040 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:58.668727 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:54:59.678099 IP 192.168.0.185.56999 > dlinkrouter.domain: 12607+ A? google.com. (28)
15:55:03.673237 IP 192.168.0.185.47018 > dns.google.domain: 12607+ A? google.com. (28)
15:55:04.738183 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:55:05.762124 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28
15:55:06.674162 IP 192.168.0.185.50867 > dns.google.domain: 12607+ A? google.com. (28)
15:55:06.785961 ARP, Request who-has dlinkrouter tell 192.168.0.185, length 28

Please let me know if you have any observations.