Selecting Interface based on Destination IP address

Hi all,

   How an interface is selected based on the destination ip address.

Thanks in advance........

this only works if the two interfaces are in the same subnet and the other is not.

hai duke,

i don't think so, for example a host has two interfaces one is connected to lan and the other to internet, then how will select the right interface to reach u r destination.

for this the "defaultrouter" or "defaultgateway" setting is used... if you ping an address in your lan, the interface in your lan will be used. if you use a internet ip (and the defautroute points to your router) the other interface will be used...

have a look here:

if u r default interface is selected as lan interface and if u want to send the packet to the internet(destination outside the lan) then which interface will be selected.(source address is 0.0.0.0 -----binding is not done)

Hello,

Per our forum rules, all users must write in English, use semi-formal or formal English language and style, and correct spelling errors.

The reason for this is that most software and operating systems are written in English and these are software related technical forums.

In addition, nearly 95% of all visitors to this site come here because they are referred by a search engine. In order for future searches on your post (with answers) to work well, you need to spell correctly!

So, as a benefit and courtesy to current and future knowledge seekers, please be careful with your language, check your spelling and correct your spelling errors. You might receive a forum infraction if you don't pay attention to this.

Also, do not write in cyberpunk or abbreviated chat style under any circumstances and do not use profanity. This is not a chat room, it is a formal knowledge base to serve you and everyone, of all ages and cultural backgrounds.

Thanks!

The UNIX and Linux Forums