0

Can these rules shorten to single line:

post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 3050 -j DNAT --to-destination 192.168.1.3:3050
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 3051 -j DNAT --to-destination 192.168.1.3:3051
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 3052 -j DNAT --to-destination 192.168.1.3:3052
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 3053 -j DNAT --to-destination 192.168.1.3:3053
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 3054 -j DNAT --to-destination 192.168.1.3:3054
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 3055 -j DNAT --to-destination 192.168.1.3:3055
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 3056 -j DNAT --to-destination 192.168.1.3:3056

1 Answer 1

1
post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp --dport 3050:3056 -j DNAT --to-destination 192.168.1.3

post-up iptables -t nat -A PREROUTING -i vmbr0 -p tcp -m multiport --dports 3050:3056,5000 -j DNAT --to-destination 192.168.1.3
1
  • Thank. How about adding an other port like 5000. 3050:3056,5000 ? Commented Aug 9, 2022 at 21:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .