Hi, I would like my LXC container to have direct access to the Internet.
My container has IP address 192.168.1.35
The container has tunneling access enabled, of course.
My default HOST /etc/network/interfaces
I added to it
When I install the service (zerotier) directly on the host it works fine, it is fully reachable from the Internet, but when I do the same in the container it is no longer fully reachable, despite firewalls disabled, in the container itself also, why does this happen and how to fix it?
My container has IP address 192.168.1.35
The container has tunneling access enabled, of course.
Code:
lxc.cgroup2.devices.allow: c 10:200 rwm
lxc.mount.entry: /dev/net dev/net none bind,create=dir
My default HOST /etc/network/interfaces
Bash:
auto lo
iface lo inet loopback
iface enp1s0 inet manual
auto vmbr0
iface vmbr0 inet static
address 192.168.1.30/24
gateway 192.168.1.1
bridge-ports enp1s0
bridge-stp off
bridge-fd 0
I added to it
Bash:
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '192.168.1.0/24' -o enp1s0 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '192.168.1.0/24' -o enp1s0 -j MASQUERADE
post-up iptables -t raw -I PREROUTING -i fwbr+ -j CT --zone 1
post-down iptables -t raw -D PREROUTING -i fwbr+ -j CT --zone 1
When I install the service (zerotier) directly on the host it works fine, it is fully reachable from the Internet, but when I do the same in the container it is no longer fully reachable, despite firewalls disabled, in the container itself also, why does this happen and how to fix it?