On May 1, 9:14 pm, Beyza <anlamar...@gmail.com> wrote:
> Hi,
>
> I want to forward an IP to another IP in RHEL 4 Linux. So, i have two
> IPs like 192.168.16.1 - 192.168.0.1 and i want to forward 192.168.16.1
> to 192.168.0.1. So it is not just port forwarding, i want to forward
> every port as well..
>
> So if i enter to my browser 192.168.16.1 or 192.168.16.1:443 it will
> be 192.168.0.1 or 192.168.0.1:443.
>
> Is there any document for that? How can i do it?
>
> Thanks,
>
> Beyza Cansever
First, you have to turn on IP Forwarding
http://systemnotesorg.blogspot.com/2...ardarding.html
Then you probably want to set up some firewall rules.
I'm not sure what you are trying to accomplish, but if you want to
allow one network to access another network, you can set up forward
rules based on the interfaces (eth0 and eth1), rather than IPs.
iptables -A FORWARD -i eth1 -j ACCEPT
iptables -A FORWARD -o eth1 -j ACCEPT
Then set up masquerading to let internal machines (on eth1 network)
out to the network on eth0
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
This doc explains it pretty well.
https://www.redhat.com/docs/manuals/...l-ipt-fwd.html