Thursday, April 8, 2021

Help with IPtables.

Hopefully someone can point me in the right direction. I am trying to host GNS3 or Eve-NG in the cloud and have access to the deployed devices through the public IPs without going through any VPN service. From what I understand I should be able to use IPtables to DNAT from the public to the private IP address.

My Public IP: 145.40.77.169 Private IP of the device(Mikrotik): 192.168.122.215/24

Here are the IPtables commands I have done so far: iptables -A INPUT-i bond0 -j ACCEPT iptables -A OUTPUT -o bond0 -j ACCEPT iptables -A INPUT -i virbr0 -J ACCEPT iptables -A OUTPUT-o virbr0 -j ACCEPT

iptables -A INPUT -m conntract --ctstate ESTABLISHED,RELATED -j ACCEPT iptables -t nat -A PREROUTING -p tcp ---dport 8291 -j DNAT --to-destination 192.168.122.215:8291 

I have also attached a few screen shots of my topology and iptables -L command after putting my iptable rules.

I am hoping someone can just point me in the right directions.

https://imgur.com/a/jGVTxSX



No comments:

Post a Comment