Re: getting IP address of interfaces .

Michael H. Warfield (
Wed, 1 Sep 1999 18:02:25 -0400 (EDT)

Senthilkumar Rajasekharan enscribed thusly:
> 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 ?

Why don't you just use dhcp?

That way one systems asks the other system what IP address to use.

> Regards,
> -Senthil


 Michael H. Warfield    |  (770) 985-6132   |
  (The Mad Wizard)      |  (770) 331-2437   |
  NIC whois:  MHW9      |  An optimist believes we live in the best of all
 PGP Key: 0xDF1DD471    |  possible worlds.  A pessimist is sure of it!

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