1830229 Members
2624 Online
109999 Solutions
New Discussion

Re: IP forwarding

 
SOLVED
Go to solution
KRS_1
Frequent Advisor

IP forwarding

Hi all,

Please let me know more about ip forwarding.

Any help will be appriciated with points


Thanks and Regards
Rajesh
4 REPLIES 4
Stuart Browne
Honored Contributor
Solution

Re: IP forwarding

IP Forwarding, as in routing, or as in address translation?

If for routing, then it's as simple as making sure that '/proc/sys/net/ipv4/ip_forward' contains a '1'. This is usually done via the 'sysctl' interface (which is configured via '/etc/sysctl.conf').

If you mean address translation, then I'll assume you're using a recent distribution and 'iptables'.

What you need to look at is the NAT table (Network Address Tralsnation) and the DNAT and SNAT jump types.

These rules live in the PREROUTING/OUTPUT and the POSTROUTING chains respectivly.

The key to adding these is the '--to' flag, i.e.

iptables -t nat -A PREROUTING -j DNAT -d 192.6.165.40 --to 192.6.165.119

This would force every request to 'www.hp.com' to one of the two IP's which respond to that name (NOTE: I use this only as an example, I do not suggest you try this!).

This can also modify the destination port, i.e.

iptables -t nat -A PREROUTING -j DNAT -p tcp --dport 80 d 192.6.165.40 --to 192.6.165.119:81

The SNAT rules work in the same manner.

These are discussed in the man page (man iptables) and also in great length in the IP Tables howto's, in particular the Netfilter Hack HOWTO, http://www.iptables.org/documentation/HOWTO//netfilter-hacking-HOWTO.txt .
One long-haired git at your service...
Steven E. Protter
Exalted Contributor

Re: IP forwarding

A frew firewall threads:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=871034

http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=624078

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Sergejs Svitnevs
Honored Contributor

Re: IP forwarding

ip forwarding means the system will route packets between interfaces.
Machine acts as a router: datagrams received on one interface are forwarded to another one.

Regards,
Sergejs
Chakravarthi
Trusted Contributor

Re: IP forwarding