Answer the question
In order to leave comments, you need to log in
Forward iptables port?
On the router, I forwarded the port only to the network 192.168.1.0, or rather to 192.168.1.2, but I need traffic from 192.168.1.2 to get to 192.168.0.3, port 3306
There are such rules that are not mine and I don’t know what they mean
Answer the question
In order to leave comments, you need to log in
In general, the problem was solved like this: From the beginning I made the network -> Enterprise Network, and then turned off the Windows firewall and ping went on
and such rules helped
sudo iptables -A FORWARD -i enp3s1 -o enp3s0 -p tcp --syn --dport 3306 -m conntrack --ctstate NEW -j ACCEPT
sudo iptables -A FORWARD -i enp3s1 -o enp3s0 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -A FORWARD -i enp3s0 -o enp3s1 -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
sudo iptables -t nat -A PREROUTING -i enp3s1 -p tcp --dport 3306 -j DNAT --to-destination 192.168.0.3
sudo iptables -t nat -A POSTROUTING -o enp3s0 -p tcp --dport 3306 -d 192.168.0.3 -j SNAT --to-source 192.168.1.2
Why do you need iptables? Just set up routes, well, you need to enable ipforwarding.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question