Script to calculate default gateway according to IP

Taking care of your Linux box.
osama
Havaldaar
Posts: 117
Joined: Fri Aug 22, 2008 9:08 am

Script to calculate default gateway according to IP

Postby osama » Wed Feb 25, 2009 10:47 am

Hello,

I have a dynamic ip address for one of 2 External NICs. I have to change gateway accordingly when one goes down. I have to calculate gateway according to assigned IP and BROADCAST address. Can any one give me a script to calculate gateway according to assigned IP and Broadcast address?

Regards,

mejam
Havaldaar
Posts: 127
Joined: Sat Oct 18, 2008 12:30 pm
Location: Lahore
Contact:

Postby mejam » Wed Feb 25, 2009 11:32 am

i have posted a Load-Balancing and Fail-over script in the forum...search for that it will help u.
Regards
Abdulrehman

osama
Havaldaar
Posts: 117
Joined: Fri Aug 22, 2008 9:08 am

Postby osama » Wed Feb 25, 2009 12:06 pm

cant find. Give me the link

mejam
Havaldaar
Posts: 127
Joined: Sat Oct 18, 2008 12:30 pm
Location: Lahore
Contact:

Postby mejam » Wed Feb 25, 2009 12:27 pm

Regards

Abdulrehman

osama
Havaldaar
Posts: 117
Joined: Fri Aug 22, 2008 9:08 am

Postby osama » Wed Feb 25, 2009 12:42 pm

No help from that script. I need gateway address

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Wed Feb 25, 2009 1:25 pm

Watch out for the !
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

osama
Havaldaar
Posts: 117
Joined: Fri Aug 22, 2008 9:08 am

Postby osama » Wed Feb 25, 2009 2:49 pm


lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Wed Feb 25, 2009 10:19 pm

Watch out for the !
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

osama
Havaldaar
Posts: 117
Joined: Fri Aug 22, 2008 9:08 am

Postby osama » Thu Feb 26, 2009 10:37 am


osama
Havaldaar
Posts: 117
Joined: Fri Aug 22, 2008 9:08 am

Postby osama » Fri Mar 06, 2009 10:16 am

Hey lambda consider following scenario

inet addr:192.168.55.75 Bcast:192.168.55.127 Mask:255.255.255.192

Gateway for this network is 192.168.55..65

That is the first IP of the network.

Can u give me a script for this

lambda
Major General
Posts: 3452
Joined: Tue May 27, 2003 7:04 pm
Location: Lahore
Contact:

Postby lambda » Fri Mar 06, 2009 2:50 pm

Watch out for the !
Isn't it amazing how so many people can type "linuxpakistan.net" into their browsers but not "google.com"?

osama
Havaldaar
Posts: 117
Joined: Fri Aug 22, 2008 9:08 am

Postby osama » Fri Mar 06, 2009 3:32 pm



Return to “Administration”

Who is online

Users browsing this forum: No registered users and 2 guests