I have the IP tables rules shown below. First questions, can I consolidate such as:
Code:
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL1 -p tcp -m -multiport --dports 21,5090,5003,6001,6002 -j DNAT --to-destination $SAMSUNG
Can I use the multiport option here? Will it route properly if I don't specify the port on the --to-destination? I can't really test this as the software on the Samsung must be accessed via phone service provider proprietary software, so I'd like to get some expert opinion before have them try it.
Current iptables rules:
Code:
# Route 1st Keytel IP accesses to configured ports to the Samsung
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL1 -p tcp --dport 21 -j DNAT --to-destination $SAMSUNG:21
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL1 -p tcp --dport 5090 -j DNAT --to-destination $SAMSUNG:5090
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL1 -p tcp --dport 5003 -j DNAT --to-destination $SAMSUNG:5003
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL1 -p tcp --dport 6001 -j DNAT --to-destination $SAMSUNG:6001
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL1 -p tcp --dport 6002 -j DNAT --to-destination $SAMSUNG:6002
# Route 2nd Keytel IP accesses to configured ports to the Samsung
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL2 -p tcp --dport 21 -j DNAT --to-destination $SAMSUNG:21
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL2 -p tcp --dport 5090 -j DNAT --to-destination $SAMSUNG:5090
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL2 -p tcp --dport 5003 -j DNAT --to-destination $SAMSUNG:5003
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL2 -p tcp --dport 6001 -j DNAT --to-destination $SAMSUNG:6001
iptables -t nat -A PREROUTING -i eth0 -s $KEYTEL2 -p tcp --dport 6002 -j DNAT --to-destination $SAMSUNG:6002