getting IP address of interfaces .

Senthilkumar Rajasekharan (
Wed, 1 Sep 1999 17:13:34 -0400 (EDT)

Hi all,

I have a configuration in which there are only two machines that are
connected either back to back over a cross over cable or a hub.

For these two machines to start exchanging IP packets the IP addresses
have to be in the same subnet (provided I do not make any modifications to
the routing tables of these hosts) .

These machines were already assigned IP addresses and were pulled off
their original network to get the configuration that I have mentioned
above. Now my problem is to keep one of these addresses (IP1)as it is and
modify the IP address of the other machine to be in the same subnet as
IP1 automatically.

Essentially I would like to have some piece of code that would do the
following :-

i) get IP address of the other machine

ii) set the IP address of this machine ( through ifconfig possibly....)

iii) do a connectivity test

Has anyone done this or has any ideas on how this possibly could be done ?


To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to