Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Networking
User Name
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.


  Search this Thread
Old 07-31-2008, 03:13 AM   #1
Registered: May 2008
Posts: 32

Rep: Reputation: 15
Script for IFCONFIG tht PING with destination ip address in same format

I want a script that should ping with the same ip address format in kernel.

Unix Shell script needed for below ques:
insmod ./xge.ko
ifconfig ethxxx up
ifconfig ethxxx down
rmmod xge

ifconfig eth2 up

ifconfig eth3 up

In above, if the second parameter of ifconfig is eth2 & corresponding ip is it should ping with like tht...I need script for tht...Plz help me
Old 07-31-2008, 10:19 AM   #2
LQ 5k Club
Registered: Aug 2005
Distribution: OpenSuse, Fedora, Redhat, Debian
Posts: 5,397
Blog Entries: 2

Rep: Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908Reputation: 908
The essence of your problem is to compose two IPs in which the second differs from the first in the last octet, and the last octet is one greater than the last octet of the first. So:
octet0plus=`expr $octet0 + 1`
echo $ip1
echo $ip2

ifconfig eth4 $ip1 up
ping $ip2
--- rod.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Destination HOST Unreachable - cannot ping gateway rpkosuri Linux - Networking 5 06-16-2008 11:38 PM
when ping I get Destination host unreachable Fuzia Linux - Networking 1 06-19-2006 01:22 AM
windows 98 m/c ping to ip address of red hat server but fails to ping hostname ravilohot Linux - Networking 2 09-07-2004 04:57 AM
Shell script ip address format check. rooch84 Linux - Software 6 08-18-2004 09:14 AM
problem to print source address and destination address jooboo Programming 2 11-26-2003 03:24 PM > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 06:30 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration