Operating System - HP-UX
1833783 Members
2234 Online
110063 Solutions
New Discussion

ip forwarding and routing

 
SOLVED
Go to solution
Ruediger Noack
Valued Contributor

ip forwarding and routing

In this moment I have some troubble with understanding ip forwarding. Therefore I don't know exactly when I *NEED* ip forwarding. Up to this day I only configured routing. Where is the point static routing isn't enough for network working properly.
Can somebody give me a simple explanation or a link to a good documentation for this.

Thanks
Ruediger
8 REPLIES 8
John Carr_2
Honored Contributor
Solution

Re: ip forwarding and routing

Hi

Agreat book to explain it all is TCP/IP Network Administration by Craig Hunt @ O'Reilly & Associates

ISBN 0-937175-82-X


defenition

ipforwarding: determines wheather the system forwards IP datagrams for another computer. By default, the system forwards datagrams only if it has more than one network interface, i.e. the system is assumed to be a gateway. The default value for ipforwarding variable is 0. the value 1 means ALWAYS forward datagrams; the value -1 means never forward datagrams.

John.
Rainer von Bongartz
Honored Contributor

Re: ip forwarding and routing

well, first of all: a server is a server and a router is a router...

If you want your server to be a router too, then you'll need to activate ip forwarding.

Regards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Ceesjan van Hattum
Esteemed Contributor

Re: ip forwarding and routing

Hi Ruediger,

To my knowledge, ip-forwarding is especially used in case you have dynamic ip-adresses.
Dial-in users with non-static addresses will be directed to the same machines, without bothering them.
Routingtables can do the same, but you really do not like to change these entries every minute.

Regards,
Ceesjan
Ron Kinner
Honored Contributor

Re: ip forwarding and routing

The only time you usually need ip forwarding ON is when you have a PC with 2 or more LANs AND you want devices on one LAN to talk to devices on the other LAN AND there is no router available with a presence on both LANs which could do the job better.

Once turned on nothing will happen unless a device on one LAN knows that it can get to the other LAN by going through your PC. It must have a route to the second LAN using your PC as a gateway AND the other device must have a return route back to the first LAN using your PC as the gateway.

Ron
Wodisch
Honored Contributor

Re: ip forwarding and routing

Hello Ruediger,

actually it quite simple:
if your station receives an IP-packet *not* meant for it (but for another ip-address) then ip_forwrading comes into the game. If it is permitted AND your system has a route towards the destination ip-address of that ip-packet, then your station will forward it (that is: will route it) to that destination (well, to the next router on the way to that destination). If ip_forwarding is NOT permitted, then your station will simply drop the ip-packet!

Every station running the ip-protocol has that ability - it is just that routers are pretty good at it (and may not do anything else)...

If you now have a station with more than one ip-address (perhaps due to having more than one interface), should it route or not?
If you say "no", then set the "ip_forwarding" to "0" (using the command "ndd") and call your station then "multi-homed" (instead of calling it "router").

HTH,
Wodisch
Ruediger Noack
Valued Contributor

Re: ip forwarding and routing

Thanks so far to all.

Ron, I'm not sure if I understand you right.
In your scenario you speak from to things.
1. Ip forwarding ON on the gateway box
2. The gateway entries on the 2 PC's in the separate LAN's.
Do you mean I need both things for routing through the gateway box OR do mean I need only one of this for working properly?

I never attended for ip forwarding ON, I always made only the gateway entries on the PC's and all worked fine.
But I don't know if it only worked because of default behavior on the HP-UX gateway box.
And in the case of default ip forwarding behavior, is it HP-UX default or TCP/IP default?

Thanks
R??diger
Ruediger Noack
Valued Contributor

Re: ip forwarding and routing

Thanks so far to all.

Ron, I'm not sure if I understand you right.
In your scenario you speak from to things.
1. Ip forwarding ON on the gateway box
2. The gateway entries on the 2 PC's in the separate LAN's.
Do you mean I need both things for routing through the gateway box OR do mean I need only one of this for working properly?

I never attended for ip forwarding ON, I always made only the gateway entries on the PC's and all worked fine.
But I don't know if it only worked because of default behavior on the HP-UX gateway box.
And in the case of default ip forwarding behavior, is it HP-UX default or TCP/IP default?

Thanks
Ruediger
Ron Kinner
Honored Contributor

Re: ip forwarding and routing

When I use "AND" I mean logical (Boolean) AND. You need all of the components for it to actually work. It can forward packets if the receiving host doesn't know how to get back to the sender but that doesn't accomplish much.

It is highly unlikely that you would ever need IP Forwarding turned on. Having it on also is considered a security risk:

http://people.hp.se/stevesk/bastion11.html

recommends turning it off.

It's an HP-UX default. Your typical window box has it off by default.

Ron