Port forwarding

Hi

I want to set up port forwarding from one network to another network. I already have this configured on the Linux box using iptables.

iptables -t nat -A PREROUTING -p tcp -i eth1 --dport 1521 -j DNAT --to 10.218.146.230
iptables -A FORWARD -p tcp -i eth1 -d 10.218.146.230 -j ACCEPT

Basically forwarding everything coming on eth1 for port 1521 to 10.218.146.230 (which is eth0).

I want to set up this configuration on solaris as well using ipfilters. I have tried following many documents on the net. But none seem to work. Please guide me as to the steps and configuration required to achieve the same on solaris or at least the equivalent commands.

PS: I am not that fluent in Solaris as in Linux. Nor have I worked with ipfilters before - always worked with iptables.

Just in case somebody is interested:

rdr dnet0 10.218.108.141/32 port 1521 -> 10.218.146.230 port 1521

will do just that if we store this rule in a file and use ipnat -f <file>.

Now I need information on having this configuration for packets from one particular IP. Any help is appreciated :slight_smile:

Here is the final solution:

Add the following rule to /etc/ipf/ipfnat.conf

rdr dnet0 from 10.218.141.156/32 to 10.218.147.210/32 port = 1521 -> 10.218.146.230 port 1521 tcp

and execute

ipnat -CFf /etc/ipf/ipfnat.conf

This will port forward oracle requests originating from 10.218.141.156 for 10.218.147.210 to 10.218.146.230.