Discussion:
Load Balancing with secondary tables (not main as in the howto)
Paa.listas
2007-11-21 14:29:05 UTC
Permalink
Hello,



We have 3 DSL connections connected to eth3 and another interface with
a dedicated link in eth0 (main table)



We want to balance selected traffic (using fwmark and iptables) through our
3 DSL connections in a secondary table named DSL (without using the
dedicated link in eth0), but the next command is not accepted, and gives us
the following error:





# ip route add default scope global nexthop via 10.0.1.1 dev eth3 weight 1
nexthop via 10.0.2.1 dev eth3 weight 3 nexthop via 10.0.3.1 dev eth3 weight
2 table DSL

Error: "nexthop" or end of line is expected instead of "table"







That because the syntax rules of ip:



# ip route add help

Usage:

ip route { add | del | change | append | replace | monitor } ROUTE

SELECTOR := [ root PREFIX ] [ match PREFIX ] [ exact PREFIX ]

[ table TABLE_ID ] [ proto RTPROTO ]

[ type TYPE ] [ scope SCOPE ]

ROUTE := NODE_SPEC [ INFO_SPEC ]

NODE_SPEC := [ TYPE ] PREFIX [ tos TOS ]

[ table TABLE_ID ] [ proto RTPROTO ]

[ scope SCOPE ] [ metric METRIC ]

INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ]...

NH := [ via ADDRESS ] [ dev STRING ] [ weight NUMBER ] NHFLAGS





The question is, can I add load balancing over a secondary table in any
other way? Why ip route add doesn't allow this?



Thanks in advance.





Note:



- Architecture:





Linux box ---- eth3 --------------- | ----- ADSL1 (IP: 10.0.1.1)

| | ----- ADSL2 (IP: 10.0.2.1)

| | ----- ADSL3 (IP: 10.0.3.1)

eth0







# ip addr show dev eth3

5: eth3: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000

link/ether 00:16:17:9d:3d:b2 brd ff:ff:ff:ff:ff:ff

inet 10.0.1.2/24 brd 10.255.255.255 scope global eth3

inet 10.0.2.2/24 brd 10.255.255.255 scope global eth3:1

inet 10.0.3.2/24 brd 10.255.255.255 scope global eth3:2
Paa.listas
2007-11-21 15:12:31 UTC
Permalink
Thanks! It works.



# -----Mensaje original-----
# De: Arnd Steinbrecher [mailto:]
# Enviado el: Miércoles, 21 de Noviembre de 2007 12:00 p.m.
# Para: Paa.listas
# Asunto: Re: [LARTC] Load Balancing with secondary tables (not main as in
# the howto)
#
# Hi,
# you have to write NODE_SPEC in front of INFO_SPEC. I you case:
#
# ip route add default scope global table DSL nexthop via 10.0.1.1 dev eth3
# weight
# 1 nexthop via 10.0.2.1 dev eth3 weight 3 nexthop via 10.0.3.1 dev eth3
# weight 2
#
# > Hello,
#
#
#
# > We have 3 DSL connections connected to eth3 and another interface
# with
# > a dedicated link in eth0 (main table)
#
#
#
# > We want to balance selected traffic (using fwmark and iptables) through
# our
# > 3 DSL connections in a secondary table named DSL (without using the
# > dedicated link in eth0), but the next command is not accepted, and gives
# us
# > the following error:
#
#
#
#
#
# > # ip route add default scope global nexthop via 10.0.1.1 dev eth3 weight
# 1
# > nexthop via 10.0.2.1 dev eth3 weight 3 nexthop via 10.0.3.1 dev eth3
# weight
# > 2 table DSL
#
# > Error: "nexthop" or end of line is expected instead of "table"
#
#
#
#
#
#
#
# > That because the syntax rules of ip:
#
#
#
# > # ip route add help
#
# > Usage:
#
# > ip route { add | del | change | append | replace | monitor }
# ROUTE
#
# > SELECTOR := [ root PREFIX ] [ match PREFIX ] [ exact PREFIX ]
#
# > [ table TABLE_ID ] [ proto RTPROTO ]
#
# > [ type TYPE ] [ scope SCOPE ]
#
# > ROUTE := NODE_SPEC [ INFO_SPEC ]
#
# > NODE_SPEC := [ TYPE ] PREFIX [ tos TOS ]
#
# > [ table TABLE_ID ] [ proto RTPROTO ]
#
# > [ scope SCOPE ] [ metric METRIC ]
#
# > INFO_SPEC := NH OPTIONS FLAGS [ nexthop NH ]...
#
# > NH := [ via ADDRESS ] [ dev STRING ] [ weight NUMBER ] NHFLAGS
#
#
#
#
#
# > The question is, can I add load balancing over a secondary table in any
# > other way? Why ip route add doesn't allow this?
#
#
#
# > Thanks in advance.
#
#
#
#
#
# > Note:
#
#
#
# > - Architecture:
#
#
#
#
#
# > Linux box ---- eth3 --------------- | ----- ADSL1 (IP: 10.0.1.1)
#
# > | | ----- ADSL2 (IP: 10.0.2.1)
#
# > | | ----- ADSL3 (IP: 10.0.3.1)
#
# > eth0
#
#
#
#
#
#
#
# > # ip addr show dev eth3
#
# > 5: eth3: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000
#
# > link/ether 00:16:17:9d:3d:b2 brd ff:ff:ff:ff:ff:ff
#
# > inet 10.0.1.2/24 brd 10.255.255.255 scope global eth3
#
# > inet 10.0.2.2/24 brd 10.255.255.255 scope global eth3:1
#
# > inet 10.0.3.2/24 brd 10.255.255.255 scope global eth3:2
#
#
#
#
#
#
#
#
#
#
#
#
#
#
#
# --
# Mit freundlichen Grüßen
# Arnd Steinbrecher
# INVERS GmbH, An den Weiden 17, 57078 Siegen
# Tel: +49 271 23888 0, Fax: +49 271 23888 29
# HRB Siegen: 4822, Geschäftsführer/CEO: Uwe Latsch

Loading...