All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeremy SALMON <jeremy.salmon@giganet.ma>
To: lartc@vger.kernel.org
Subject: [LARTC] 3 internet connexions - Problem with my script
Date: Wed, 22 Jun 2005 10:48:34 +0000	[thread overview]
Message-ID: <42B94202.10904@giganet.ma> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 3715 bytes --]

Hi,

I have a problem with my script.

I have a debian with a kernel 2.6.8 patched with patch-2.6.8-ja1.diff of 
nano.txt site.

I have 3 internet connections :
    - eth1 :
          - ip : 192.168.8.75
          - gw : 192.168.8.73
    - eth2 :
          - ip : 192.168.1.200
          - gw : 192.168.1.2
    - eth3 :
          - ip : 192.168.2.200
          - gw : 192.168.2.1

    and my eth0 for local network (ip : 192.168.212.235)

My Load_Balancing.sh script :
/*IFI="eth0"
IPI="192.168.212.235"
NMI="24"

IFE2="eth1"
IPE2="196.200.8.75"
NWE2="196.200.8.0"
NME2="29"
BRD2="196.200.8.255"
GWE2="196.200.8.73"

IFE1="eth2"
IPE1="192.168.1.200"
NWE1="192.168.1.0"
NME1="24"
BRD1="192.168.1.255"
GWE1="192.168.1.2"

IFE3="eth3"
IPE3="192.168.2.200"
NWE3="192.168.2.0"
NME3="24"
BRD3="192.168.2.255"
GWE3="192.168.2.1"

# Configuration de l'interface de Loopback
ip link set lo up
ip addr add 127.0.0.1/8 brd + dev lo

# Configuration de l'interface interne
ip link set $IFI up
ip addr add $IPI/$NMI brd + dev $IFI
ip rule add prio 50 table main
ip route del default table main

# Configuration de la premiere connexion Internet
ip link set $IFE1 up
ip addr flush dev $IFE1
ip addr add $IPE1/$NME1 brd $BRD1 dev $IFE1

# Configuration de la deuxieme connexion Internet
ip link set $IFE2 up
ip addr flush dev $IFE2
ip addr add $IPE2/$NME2 brd $BRD2 dev $IFE2

# Configuration de la troisieme connexion Internet
ip link set $IFE3 up
ip addr flush dev $IFE3
ip addr add $IPE3/$NME3 brd $BRD3 dev $IFE3

ip rule add prio 222 table 222
ip route add default scope global \
nexthop via $GWE1 dev $IFE1 weight 1 \
nexthop via $GWE2 dev $IFE2 weight 4 \
nexthop via $GWE3 dev $IFE3 weight 1

ip rule add prio 201 from $NWE1/$NME1 table 201
ip route add default via $GWE1 dev $IFE1 src $IPE1 proto static table 201
ip route append prohibit default table 201 metric 1 proto static

ip rule add prio 202 from $NWE2/$NME2 table 202
ip route add default via $GWE2 dev $IFE2 src $IPE2 proto static table 202
ip route append prohibit default table 202 metric 1 proto static

ip rule add prio 203 from $NWE3/$NME3 table 203
ip route add default via $GWE3 dev $IFE3 src $IPE3 proto static table 203
ip route append prohibit default table 203 metric 1 proto static*/

And my firewall.sh script for nat :

*/IFI="eth0"
IPI="192.168.212.235"
NWI="192.168.212.0"
NMI="24"

IFE2="eth1"
IPE2="196.200.8.75"
NWE2="196.200.8.0"
NME2="29"
BRD2="196.200.8.255"
GWE2="196.200.8.73"

IFE1="eth2"
IPE1="192.168.1.200"
NWE1="192.168.1.0"
NME1="24"
BRD1="192.168.1.255"
GWE1="192.168.1.2"

IFE3="eth3"
IPE3="192.168.2.200"
NWE3="192.168.2.0"
NME3="24"
BRD3="192.168.2.255"
GWE3="192.168.2.1"

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o $IFE1 -s $NWI/$NMI -j MASQUERADE
iptables -t nat -A POSTROUTING -o $IFE2 -s $NWI/$NMI -j MASQUERADE
iptables -t nat -A POSTROUTING -o $IFE3 -s $NWI/$NMI -j MASQUERADE

iptables -t filter -N keep_state
iptables -t filter -A keep_state -m state --state RELATED,ESTABLISHED -j 
ACCEPT
iptables -t filter -A keep_state -j RETURN

iptables -t nat -N keep_state
iptables -t nat -A keep_state -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -t nat -A keep_state -j RETURN

iptables -t nat -A PREROUTING -j keep_state
iptables -t nat -A POSTROUTING -j keep_state
iptables -t nat -A OUTPUT -j keep_state

iptables -t filter -A INPUT -j keep_state
iptables -t filter -A FORWARD -j keep_state
iptables -t filter -A OUTPUT -j keep_state/*

I have 30 pc under this gateway.

The only website used by PC is http://example.google.fr

My BIG problem is all PC use just one interface of this gateway (eth2) 
and I haven't load balancing between connections.

Someone can help me?

Thanks

[-- Attachment #1.2: Type: text/html, Size: 4925 bytes --]

[-- Attachment #2: Type: text/plain, Size: 143 bytes --]

_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc

             reply	other threads:[~2005-06-22 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-22 10:48 Jeremy SALMON [this message]
2005-06-22 14:22 ` [LARTC] 3 internet connexions - Problem with my script gypsy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42B94202.10904@giganet.ma \
    --to=jeremy.salmon@giganet.ma \
    --cc=lartc@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.