Howto: IP forwarding on same server using iptables.

Posted on Updated on

Here in my server has two IP’s , Primary IP has listening to public network and secondary is private IP, Some of the service is listening to my secondary IP, I need to connect it from public.

I used to the simple Iptable rule to use IP forwarding so  that every traffic to the primary IP has transfered to the secondery. then I can access all the service that using both primary and secondery IP’s.

iptables -t nat -A PREROUTING -i eth0 -p tcp -j DNAT --to 192.168.2.1
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s