LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: route on non-ip interface?

To: "tc lewis" <tcl@xxxxxxxxx>, "Joseph Mack" <mack.joseph@xxxxxxx>
Subject: Re: route on non-ip interface?
Cc: <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
From: "Ted Pavlic" <tpavlic@xxxxxxxxxxx>
Date: Wed, 12 Jul 2000 16:40:11 -0400
You basically want to do device routing. There's nothign special about
this -- many routers do it... NT even does it. So does Linux.

Your original route command should work

route add -net 192.168.100.0 netmask 255.255.255.0 dev eth2

as long as you've brought up eth2. Now tricking Linux into bringing up eth2
without an address might be the hard part.

Try this:

ifconfig eth2 0.0.0.0 up

Or heck:

ifconfig eth2 0 up

That should create an eth2 device that you should be able to route across
(I'm guessing -- haven't tried it -- but it's just a guess).

Hope that works. All the best --
Ted

----- Original Message -----
From: "tc lewis" <tcl@xxxxxxxxx>
To: "Joseph Mack" <mack.joseph@xxxxxxx>
Cc: <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Sent: Wednesday, July 12, 2000 3:36 PM
Subject: Re: route on non-ip interface?


>
> i was confused when i wrote this message.  let me try to clear some things
> up and be more verbose:
>
> yes, there are 3 network interfaces in the machine, but i don't think i'll
> be using eth0 at all.
>
> director:
> eth1 = director's ip. (let's say 64.208.49.131)
> eth1:0 = vip (64.208.49.132)
> eth2 = to real server network (192.168.100.0/24)
>
> real server 1 = 192.168.100.99 on eth1
> real server 2 = 192.168.100.98 on eth1
> both use the ipchains method of avoiding the arp problem (because i have
> to redirect port 80 to a non-priv port anyway)
>
> real servers have a gateway route back to the router of 64.208.49.0/24
> network (64.208.49.0/24 and 192.168.100.0/24 are on the same physical
> segment).
>
> what i'm asking is: does the director's eth2 need an ip on
> 192.168.100.0/24, or can i just somehow add that route to that interface
> to tell the machine to send packets that way?  it's not so much an lvs
> question as a linux ifconfig/route question in general.  with lvs, the
> real servers are never going to care about the director's interface ip,
> since there's no direct tcp/ip connections or anything there, correct, but
> it looks like it still needs an ip anyway, just so i can tell the machine
> to route 192.168.100.0/24 over eth2 instead of eth1.
>
>
> ie:
> - - - - -
> - - - - -
> - - - - -
> [root@lhr /root]# /sbin/ifconfig -a
> eth0      Link encap:Ethernet  HWaddr 00:D0:B7:AC:26:07
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:100
>           Interrupt:9 Base address:0x8000
>
> eth1      Link encap:Ethernet  HWaddr 00:C0:95:E2:A8:B1
>           inet addr:64.208.49.131  Bcast:64.208.49.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:44 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:2 errors:1 dropped:0 overruns:0 carrier:2
>           collisions:0 txqueuelen:100
>           Interrupt:10 Base address:0xcc00
>
> eth2      Link encap:Ethernet  HWaddr 00:C0:95:E2:A8:B0
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:100
>           Interrupt:11 Base address:0xc880
>
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           UP LOOPBACK RUNNING  MTU:3924  Metric:1
>           RX packets:14 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>
> [root@lhr /root]# /sbin/route -n
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
> 64.208.49.131   0.0.0.0         255.255.255.255 UH    0      0        0
eth1
> 64.208.49.0     0.0.0.0         255.255.255.0   U     0      0        0
eth1
> 127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
> 0.0.0.0         64.208.49.1     0.0.0.0         UG    0      0        0
eth1
> [root@lhr /root]# /sbin/route add -net 192.168.100.0 netmask 255.255.255.0
dev eth2
> SIOCADDRT: No such device
> [root@lhr /root]# /sbin/ifconfig eth2 192.168.100.131 netmask
255.255.255.0 up
> [root@lhr /root]# /sbin/route add -net 192.168.100.0 netmask 255.255.255.0
dev eth2
> [root@lhr /root]# /sbin/ifconfig -a
> eth0      Link encap:Ethernet  HWaddr 00:D0:B7:AC:26:07
>           BROADCAST MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:100
>           Interrupt:9 Base address:0x8000
>
> eth1      Link encap:Ethernet  HWaddr 00:C0:95:E2:A8:B1
>           inet addr:64.208.49.131  Bcast:64.208.49.255  Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:91 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:2 errors:1 dropped:0 overruns:0 carrier:2
>           collisions:0 txqueuelen:100
>           Interrupt:10 Base address:0xcc00
>
> eth2      Link encap:Ethernet  HWaddr 00:C0:95:E2:A8:B0
>           inet addr:192.168.100.131  Bcast:192.168.100.255
Mask:255.255.255.0
>           UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
>           RX packets:0 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:100
>           Interrupt:11 Base address:0xc880
>
> lo        Link encap:Local Loopback
>           inet addr:127.0.0.1  Mask:255.0.0.0
>           UP LOOPBACK RUNNING  MTU:3924  Metric:1
>           RX packets:14 errors:0 dropped:0 overruns:0 frame:0
>           TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
>           collisions:0 txqueuelen:0
>
> [root@lhr /root]# /sbin/route -n
> Kernel IP routing table
> Destination     Gateway         Genmask         Flags Metric Ref    Use
Iface
> 64.208.49.131   0.0.0.0         255.255.255.255 UH    0      0        0
eth1
> 192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0
eth2
> 192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0
eth2
> 64.208.49.0     0.0.0.0         255.255.255.0   U     0      0        0
eth1
> 127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
> 0.0.0.0         64.208.49.1     0.0.0.0         UG    0      0        0
eth1
> - - - - -
> - - - - -
> - - - - -
>
> the "SIOCADDRT: No such device" is what i'm asking about.
>
> the vip and any ipvsadm rules have not yet been added...
>
> -tcl.
>
>
>
> On Wed, 12 Jul 2000, Joseph Mack wrote:
>
> > tc lewis wrote:
> >
> >
> > > is it possible to have a route specified on an interface that is not
> > > assigned an ip?  for example, on my lvs machines, i have traffic
coming in
> > > to some public ip on interface eth1,
> >
> > I need more information
> >
> > the VIP is on eth1 (the 2nd NIC) on the director?
> >
> > > but then want to forward it via
> > > direct routing to a real server on 192.168.100.0/24.  i was hoping to
do
> > > this over eth2.
> >
> > eth2 is the 3rd NIC on the director?
> >
> > > this probably doesn't make any sense, as direct routing
> > > works on the link layer,
> >
> > link layer between the director and the realserver, but the incoming
packet to
> > the director can come in one NIC and go out another NIC. Look at
> > my performance tests for 1 and 2 NIC directors on
> >
> >
http://www.linuxvirtualserver.org/Joseph.Mack/performance/single_realserver_
performance.html
> >
> > which describes their setup (the configure script will also set
> > this up for you).
> >
> > > this would work if i put
> > > a 192.168.100.x ip on eth2, correct?  but without it, route add -net
> > > 192.168.100.0 netmask 255.255.255.0 dev eth2 just gives me an error
about
> > > eth2 not existing or some such mess.
> >
> > you do have 3 NICs in the director?
> >
> > If the URL above isn't any help then:
> >
> > what's the network for the RIPs (192.168.100.0/24?)
> > the network for the connection from the router (or client) to the
director?
> > The VIP and the IP's on the 3 NICs on the director?
> >
> > Joe
> > --
> > Joseph Mack PhD, Senior Systems Engineer, Lockheed Martin
> > contractor to the National Environmental Supercomputer Center,
> > mailto:mack.joseph@xxxxxxx ph# 919-541-0007, RTP, NC, USA
> >
>
>
>
>
>



<Prev in Thread] Current Thread [Next in Thread>