Advertisement

05.29.2008 at 02:42PM PDT, ID: 23443075
[x]
Attachment Details

NAT Commands To Forward Ports Between Multiple LAN IP Addresses

Asked by nss39759 in Linux Networking, Network Routers, Networking Hardware Firewalls

Tags: , , ,

Currently using the following rule to route one (1) WAN IP to one (1) LAN IP address: (addresses have been adjusted for security)

/usr/sbin/ip addr add 77.333.207.114/25 dev vlan1 brd +
/usr/sbin/iptables -I PREROUTING -t nat -d 77.333.207 -j DNAT --to-destination 10.0.1.7
/usr/sbin/iptables -I POSTROUTING -t nat -s 10.0.1.7 -j SNAT --to 77.333.207
/usr/sbin/iptables -I FORWARD -d 10.0.1.7 -p tcp -m multiport --dports 25,3101,80,7080,7443,7005,443,2080,2081,2082 -j ACCEPT

This works well for forwarding all ports to just one internal LAN address. However, we'd like to forward the first four ports, 25,3101,80,7080, to an ADDITIONAL internal LAN address. So how could I modify the above rule to forward different ports to two (2) different internal LAN IP addresses? Would this require a seperate vlan e.g. vlan2 (/usr/sbin/ip addr add 77.333.207.114/25 dev vlan2 brd +)?

Thank you in advance.
PCL
NSS39759Start Free Trial
 
 
[+][-]05.29.2008 at 10:28PM PDT, ID: 21675432

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Linux Networking, Network Routers, Networking Hardware Firewalls
Tags: DD-WRT, v23 SP2, Linksys WRT54G Firmware Upgrade, NAT iptables routing port forwarding multiple IP Addresses
Sign Up Now!
Solution Provided By: Blaz
Participating Experts: 1
Solution Grade: A
 
 
[+][-]05.30.2008 at 09:10AM PDT, ID: 21679102

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 09:50AM PDT, ID: 21679421

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628