Here is my /etc/network/interfaces file.
The container has been assigned the following IP and gateway.
The container can access the net fine. I can nmap to it from the host from the 10.10.10.100 address, but I cannot do it from the public address. The commented out lines are from when I was attempting to do this via an older method I've seen posted a few times. The results ae the same. I have also tried without the
Code:
auto lo
iface lo inet loopback
auto eno1
iface eno1 inet static
address (Public IP)/32
gateway (Public IP gateway)
auto vmbr0
iface vmbr0 inet static
address 10.10.10.1/24
bridge-ports none
bridge-stp off
bridge-fd 0
post-up echo 1 > /proc/sys/net/ipv4/ip_forward
post-up iptables -t nat -A POSTROUTING -s '10.10.10.1/24' -o eno1 -j MASQUERADE
post-down iptables -t nat -D POSTROUTING -s '10.10.10.1/24' -o eno1 -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
iptables -t nat -A PREROUTING -i vmbr0 -p [tcp/udp] --dport 6000 -j DNAT --to-destination 10.10.10.100:6000
# post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 6000 -j DNAT --to 10.10.10.100:6000
# post-down iptables -t nat -D PREROUTING -i vmbr0 -p tcp --dport 6000 -j DNAT --to 10.10.10.100:6000
The container has been assigned the following IP and gateway.
10.10.10.100/24 10.10.10.1
The container can access the net fine. I can nmap to it from the host from the 10.10.10.100 address, but I cannot do it from the public address. The commented out lines are from when I was attempting to do this via an older method I've seen posted a few times. The results ae the same. I have also tried without the
i vmbr0]
element as per the wiki. The results are still the same.
Code:
root@:~# nmap -sT -sU 10.10.10.100 -p 6000
Starting Nmap 7.70 ( https://nmap.org ) at 2021-06-11 08:15 UTC
Nmap scan report for 10.10.10.100
Host is up (0.000049s latency).
PORT STATE SERVICE
6000/tcp open X11
6000/udp closed X11
MAC Address: 36:D3:DC:A0:CB:C4 (Unknown)
Nmap done: 1 IP address (1 host up) scanned in 0.55 seconds
root@:~# nmap -sT -sU (Public- P) -p 6000
Starting Nmap 7.70 ( https://nmap.org ) at 2021-06-11 08:15 UTC
Nmap scan report for (Public IP)
Host is up (0.000055s latency).
PORT STATE SERVICE
6000/tcp closed X11
6000/udp closed X11
Nmap done: 1 IP address (1 host up) scanned in 0.28 seconds