[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Network addressing



>>>>> "Kaa" == \[ Kaa \] <Kaa> writes:

    Kaa> I have two machines [...] One is 24.6.xxx.xxx, and the
    Kaa> other is 24.5.xxx.xxx. [...] However the ISP says that the
    Kaa> netmask for these addresses should be 255.255.255.0 [...]
    Kaa> So [...] can I simply set the netmask to 255.0.0.0
    Kaa> on both of them and put appropriate entries into the
    Kaa> /etc/hosts file?

    >> [...]
    >> route add -host other_machines_name gw this_machines_name
    >> 
    >> on each machine should work. [...]

    Kaa> Wouldn't this set up a loop? Machine A sends a packet to
    Kaa> machine B. Looks into the routing table, finds that the
    Kaa> gateway is machine A. Send the packet to itself, repeat until
    Kaa> something breaks.

>From the man page for route(8):
	 
	 If you specify the adress of one of your local interfaces, it
	 will be used to decide about the interface to which the
	 packets should be routed to. This is a BSDism compatibility
	 hack.

In other words, "route" figures out which interface has the IP address
that "this_machines_name" resolves to, and acts as if you had
specified that interface with "dev blah".
-- 
I get my monkeys for nothing and my chimps for free.
http://www.clark.net/pub/hermit/

Attachment: pgp7CdGI3rGqN.pgp
Description: PGP signature


Reply to: