Re: Routing from me to myself. Help.route problem

From: P Gentry (rdgentry1_at_cablelynx.com)
Date: 03/23/04


Date: 23 Mar 2004 09:22:26 -0800

spamreceiver@o2.pl (Krzychu) wrote in message news:<405f4c1f.0403221740.6bce72b5@posting.google.com>...

Keep your cross-posting (and top posting) to a minimum (none is
preferred if reasonable). Send your post where it will do the most
good and ask where to send if you are not sure. I've trimmed them
back and now others may "lose" this thread but the others were not
appropriate anyway -- in fact, comp.os.linux.misc is not either but
sees lots of traffic where this may already have been seen.

> Hello.
>
> I have unusual problem. :)
> I would like to send data from one alias of the same interface to
> another.
> Traffic should be "gatewayed" through another computer.

Only happens when the hosts are on different subnets. Local traffic
(on the same subnet) does not use a router.

> In case it was not clear.
> Simplified example:
> host A:
> eth0:1 - 10.0.4.2
> eth0:2 - 10.0.5.2
> ***something-i-can-not-work-out - check below***
> route add 10.0.5.2 gw 10.0.4.1
>
> host B:
> eth0:1 - 10.0.4.1
> eth0:2 - 10.0.5.1
> iptables -t filter -A FORWARD -s 10.0.4.2 -d 10.0.5.2

This is not enough info in any setting, as routing needs to know the
netmask to understand if these two IPs are local (ie., on same subnet)
or on different subnets.

> is there any way, that i could make host A to use table of routing
> instead his direct connection to his own interface? After clearing whole routing
> table he is still able to ping his own address 10.0.5.2- i do not want
> him to do it. however, i want him to be "pingable" to another host.
>
> I know it is unclear. I know it is crazy.

Yes, it is unclear, but it doesn't sound crazy -- just may not be how
to achieve what you want.

> It is my idea to test implementation of ip routing protocols using only
> two computers. ...

With just two computers, you would need each one to have two nics.
-- Comp0-eth0-net0 <--> Comp1-eth0-net0
-- Comp0-eth1-net1 <--> Comp1-eth1-net1
Traffic will not be sent out on the same interface on which it was
received, thus the "routing" computer (Comp1) needs two nics.
Likewise, the "sending" computer needs two nics -- one on the
"sending" net and one on the "receiving" net.

> ... If this above would work, there would be no problem to build
> whole bunch of hosts and links between them.
>
> Thank you in advance.

This would be much easier to handle and understand with two _physical_
nics in each computer. Aliases can be configured to act as a
"virtual" nic on a different net, but you would end up learning more
than you want or need to learn about the internal Linux routing
mechanisms than you would learn about IP routing over a network.

A "bunch" of hosts physically connected on the same subnet can
_already_ communicate with each other and don't need nor will they use
routing to do so. Small, inexpensive 4 or 8 port switches make
connecting the machines a snap. So, I'm not sure I understand what
you are trying to achieve.

Be sure to review the howto's about networking, bridging, and routing
if you need more complete background:
http://www.tldp.org/HOWTO/HOWTO-INDEX/howtos.html
Also:
http://www.cisco.com/univercd/cc/td/doc/cisintwk/ito_doc/index.htm

There are many other good sources about networking on the web -- just
Google.

hth,
prg
email above disabled



Relevant Pages

  • Re: MultiHomed Workstation - Which NIC is being used?
    ... Regardless of which interface received ... the same routing rules apply for return traffic. ... >> the subnet mask. ... >> load balancing of multiple NICs and default gateways. ...
    (microsoft.public.win2000.networking)
  • Re: Default Gateway Setting not set after Reboot
    ... > interested in routing between them at this time. ... If you ping one of the nics that is in a different subnet ... to the subnet that the DFG is part of, but other than that it is a global ... machine that all the other DFG dialog box locations for the other NICs ...
    (microsoft.public.win2000.networking)
  • Re: A duplicate name has been detected on the TCP network
    ... I understand using 2 nic's for routing, but I do not need to do routing one these servers. ... What you will do is create issues on your subnet when you ... |>Generally a machine with two NICs is called "multi-homed" and has each NIC ...
    (microsoft.public.windows.server.networking)
  • Re: Routing from me to myself. Help.route problem
    ... Only happens when the hosts are on different subnets. ... This is not enough info in any setting, as routing needs to know the ... netmask to understand if these two IPs are local (ie., on same subnet) ... you would need each one to have two nics. ...
    (comp.os.linux.misc)
  • Re: Multiple external interfaces
    ... >> It sounds like you need to set up routing tables to have one segment get ... see in outgoing frames/packets -- they never see extB's IP or MAC). ... All other dual line setups to a single ISP I've seen required static ... external NICs and just one internal NIC? ...
    (comp.os.linux.networking)