LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Why my LXC container cannot ping/ssh/netcat remote of 169.254.X.X subnet ? (https://www.linuxquestions.org/questions/linux-networking-3/why-my-lxc-container-cannot-ping-ssh-netcat-remote-of-169-254-x-x-subnet-4175655696/)

buchmann 06-14-2019 07:35 AM

Why my LXC container cannot ping/ssh/netcat remote of 169.254.X.X subnet ?
 
Hi,

This is a quick overview of the setup:
- 1 PC (host + LXC container)
- 1 "remote" device (RJ45 wire to PC) using avahi: 169.254.7.236

I would like to do:
remote_device$ ping 169.254.2.123 # failed to ping container IP from remote device
container$ ping 169.254.7.236 # failed to ping remote device from container

The following works:
host$ ping 169.254.7.236 # ping remote device from host OK
remote_device$ ping 169.254.5.206 # ping host from remote device OK
remote_device$ ping linuxquestions.org #*ping the best server ever OK

I guess the problem could be resolved by adding rules in iptables. So I tried unsuccesfully. Yes. I do not understand what I am doing. So, I provide the original state before my tests:
Quote:

$ sudo iptables -L -v
Chain INPUT (policy ACCEPT 2 packets, 134 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp -- virbr0 any anywhere anywhere udp dpt:domain
0 0 ACCEPT tcp -- virbr0 any anywhere anywhere tcp dpt:domain
0 0 ACCEPT udp -- virbr0 any anywhere anywhere udp dpt:bootps
0 0 ACCEPT tcp -- virbr0 any anywhere anywhere tcp dpt:bootps
0 0 ACCEPT tcp -- lxcbr0 any anywhere anywhere tcp dpt:domain
0 0 ACCEPT udp -- lxcbr0 any anywhere anywhere udp dpt:domain
0 0 ACCEPT tcp -- lxcbr0 any anywhere anywhere tcp dpt:bootps
0 0 ACCEPT udp -- lxcbr0 any anywhere anywhere udp dpt:bootps

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT all -- any virbr0 anywhere 192.168.122.0/24 ctstate RELATED,ESTABLISHED
0 0 ACCEPT all -- virbr0 any 192.168.122.0/24 anywhere
0 0 ACCEPT all -- virbr0 virbr0 anywhere anywhere
0 0 REJECT all -- any virbr0 anywhere anywhere reject-with icmp-port-unreachable
0 0 REJECT all -- virbr0 any anywhere anywhere reject-with icmp-port-unreachable
0 0 ACCEPT all -- any lxcbr0 anywhere anywhere
0 0 ACCEPT all -- lxcbr0 any anywhere anywhere

Chain OUTPUT (policy ACCEPT 2 packets, 134 bytes)
pkts bytes target prot opt in out source destination
0 0 ACCEPT udp -- any virbr0 anywhere anywhere udp dpt:bootpc
Anyone have solutions or hints ?

Best regards

273 06-15-2019 12:35 PM

Why are you using autoip? I haven't read the specifications but I don't think it's designed for the things you are trying to do.

buchmann 06-15-2019 02:06 PM

Hi 273

Thank you for the reply.

Autoipd just provide me a way to get an IP without collision. I am trying to simulate an embedded software using an LXC. The embedded device use autoipd.

I guess it does not matter. I guess I just need a way to route packets from/to an LXC in subnet 169.254.x.x.


All times are GMT -5. The time now is 08:31 PM.