Modérateur: modos Ixus
pkaer a écrit:@faycal,
Salut....
Tu peux trouver une iso que j'ai compilé avec le Loadbalancing ainsi que IMQ+Layer7 à cette adresse :
http://www.kaerlagad.fr.st
Si tu arrives dans le répertoire de Trend (problème de redirection Ulimit), remontes d'un niveau (Parent Directory) pour voir celui d'IPCop.
@+
PK
Sagem F@st 908 eth (Free 2 Mb)
|
|
routeur WRT54G
|
Switch du routeur ---- Hub ---- PC du voisin (XP Pro) --- Speedtouch USB (Wanadoo 1 Mb partagé avec XP )
| \ Autres PCs du voisin sur la coonexion Wanadoo
|
PCs persos (XP Pro)
#!/bin/sh
#
#-----------------------------------------------------------------
eval $(/usr/local/bin/readhash /var/ipcop/ethernet/settings)
IPCOP_ALIAS_CONFIG='/var/ipcop/ethernet/aliases'
while read line; do
ALIAS=($(echo $line | cut --delimiter=',' --output-delimiter=' ' -f1,3,12,29))
done < ${IPCOP_ALIAS_CONFIG}
# default route setting
GW0=$DEFAULT_GATEWAY
IP1=192.168.1.201
GW1=192.168.1.1
NET1=$RED_NETADDRESS/24
DEV1=$RED_DEV
TABLE1=20
IP2=192.168.1.202
GW2=192.168.1.101
NET2=$RED_NETADDRESS/24
DEV2=$RED_DEV
TABLE2=30
ifconfig eth1 $IP1 netmask 255.255.255.0 broadcast 192.168.1.255
ifconfig eth2 $IP2 netmask 255.255.255.0 broadcast 192.168.1.255
# del all previous rules...
#
resetRoute() {
ip rule del prio 10
ip rule del from $NET1 table $TABLE1
ip rule del from $NET2 table $TABLE2
ip rule del prio 100
ip route del default via $GW1 dev $DEV1 src $IP1 table $TABLE1
ip route del default via $GW2 dev $DEV2 src $IP2 table $TABLE2
ip route del default table 100 proto static \
nexthop via $GW1 dev $DEV1 weight 2\
nexthop via $GW2 dev $DEV2 weight 1
# restore default route
ip route add default via $GW0
}
# start the rules....
#
setRoute() {
# delete default route before we start.
ip route del default
ip rule add prio 10 table main
ip rule add prio $TABLE1 from $NET1 table $TABLE1
ip route append default via $GW1 dev $DEV1 src $IP1 table $TABLE1
ip route append prohibit default table $TABLE1 metric 1 proto static
ip rule add prio $TABLE2 from $NET2 table $TABLE2
ip route append default via $GW2 dev $DEV2 src $IP2 table $TABLE2
ip route append prohibit default table $TABLE2 metric 2 proto static
ip rule add prio 100 table 100
ip route add default table 100 proto static \
nexthop via $GW1 dev $DEV1 \
nexthop via $GW2 dev $DEV2
#ip rule add prio 200 table 200
#ip route append default via $GW1 dev $DEV1 src $IP1 table 200
#ip route append default via $GW2 dev $DEV2 src $IP2 table 200
}
status() {
ip route list table main
ip rule
}
stop() {
resetRoute
}
start() {
setRoute
}
case "$1" in
start)
echo "Starting loadbalancing"
start
;;
stop)
echo "Shutting down loadbalancing"
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
ip rule add prio $TABLE1 from $NET1 table $TABLE1
ip route append default via $GW1 dev $DEV1 src $IP1 table $TABLE1
ip route append prohibit default table $TABLE1 metric 1 proto static
ip rule add prio $TABLE2 from $NET2 table $TABLE2
ip route append default via $GW2 dev $DEV2 src $IP2 table $TABLE2
ip route append prohibit default table $TABLE2 metric 2 proto static
ip rule add prio 100 table 100
ip route add default table 100 proto static \
nexthop via $GW1 dev $DEV1 \
nexthop via $GW2 dev $DEV2
#ip rule add prio 200 table 200
#ip route append default via $GW1 dev $DEV1 src $IP1 table 200
#ip route append default via $GW2 dev $DEV2 src $IP2 table 200
@faycal,
Salut....
Tu peux trouver une iso que j'ai compilé avec le Loadbalancing ainsi que IMQ+Layer7 à cette adresse :
http://www.kaerlagad.fr.st
Si tu arrives dans le répertoire de Trend (problème de redirection Ulimit), remontes d'un niveau (Parent Directory) pour voir celui d'IPCop.
@+
PK
#!/bin/sh
#
#-----------------------------------------------------------------
eval $(/usr/local/bin/readhash /var/ipcop/ethernet/settings)
IPCOP_ALIAS_CONFIG='/var/ipcop/ethernet/aliases'
while read line; do
ALIAS=($(echo $line | cut --delimiter=',' --output-delimiter=' ' -f1,3,12,29))
done < ${IPCOP_ALIAS_CONFIG}
# default route setting
GW0=$DEFAULT_GATEWAY
IP1=192.168.1.201
GW1=192.168.1.1
NET1=$RED_NETADDRESS/24
DEV1=$RED_DEV
TABLE1=20
IP2=192.168.1.202
GW2=192.168.1.101
NET2=$RED_NETADDRESS/24
DEV2=$RED_DEV
TABLE2=30
ifconfig eth1 $IP1 netmask 255.255.255.0 broadcast 192.168.1.255
ifconfig eth2 $IP2 netmask 255.255.255.0 broadcast 192.168.1.255
# del all previous rules...
#
resetRoute() {
ip rule del prio 10
ip rule del from $NET1 table $TABLE1
ip rule del from $NET2 table $TABLE2
ip rule del prio 100
ip route del default via $GW1 dev $DEV1 src $IP1 table $TABLE1
ip route del default via $GW2 dev $DEV2 src $IP2 table $TABLE2
ip route del default table 100 proto static \
nexthop via $GW1 dev $DEV1 weight 2\
nexthop via $GW2 dev $DEV2 weight 1
# restore default route
ip route add default via $GW0
}
# start the rules....
#
setRoute() {
# delete default route before we start.
ip route del default
ip rule add prio 10 table main
ip rule add prio $TABLE1 from $NET1 table $TABLE1
ip route append default via $GW1 dev $DEV1 src $IP1 table $TABLE1
ip route append prohibit default table $TABLE1 metric 1 proto static
ip rule add prio $TABLE2 from $NET2 table $TABLE2
ip route append default via $GW2 dev $DEV2 src $IP2 table $TABLE2
ip route append prohibit default table $TABLE2 metric 2 proto static
ip rule add prio 100 table 100
ip route add default table 100 proto static \
nexthop via $GW1 dev $DEV1 \
nexthop via $GW2 dev $DEV2
#ip rule add prio 200 table 200
#ip route append default via $GW1 dev $DEV1 src $IP1 table 200
#ip route append default via $GW2 dev $DEV2 src $IP2 table 200
}
status() {
ip route list table main
ip rule
}
stop() {
resetRoute
}
start() {
setRoute
}
case "$1" in
start)
echo "Starting loadbalancing"
start
;;
stop)
echo "Shutting down loadbalancing"
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
esac
#!/bin/sh
#
#-----------------------------------------------------------------
eval $(/usr/local/bin/readhash /var/ipcop/ethernet/settings)
IPCOP_ALIAS_CONFIG='/var/ipcop/ethernet/aliases'
while read line; do
ALIAS=($(echo $line | cut --delimiter=',' --output-delimiter=' ' -f1,3,12,29))
done < ${IPCOP_ALIAS_CONFIG}
# default route setting
#GW0=$DEFAULT_GATEWAY
GW0=192.168.1.1
IP1=192.168.1.201
GW1=192.168.1.1
NET1=192.168.1.0/24
DEV1=eth1
TABLE1=20
IP2=192.168.1.202
GW2=192.168.1.101
NET2=192.168.1.0/24
DEV2=eth2
TABLE2=30
ifconfig eth1 $IP1 netmask 255.255.255.0 broadcast 192.168.1.255 up
ifconfig eth2 $IP2 netmask 255.255.255.0 broadcast 192.168.1.255 up
# del all previous rules...
#
resetRoute() {
ip rule del prio 10
ip rule del from $NET1 table $TABLE1
ip rule del from $NET2 table $TABLE2
ip rule del prio 100
ip route del default via $GW1 dev $DEV1 src $IP1 table $TABLE1
ip route del default via $GW2 dev $DEV2 src $IP2 table $TABLE2
ip route del default table 100 proto static \
nexthop via $GW1 dev $DEV1 weight 1\
nexthop via $GW2 dev $DEV2 weight 1
# restore default route
ip route add default via $GW0
}
# start the rules....
#
setRoute() {
# delete default route before we start.
ip route del default
ip rule add prio 10 table main
ip rule add prio $TABLE1 from $NET1 table $TABLE1
ip route append default via $GW1 dev $DEV1 src $IP1 table $TABLE1
ip route append prohibit default table $TABLE1 metric 1 proto static
ip rule add prio $TABLE2 from $NET2 table $TABLE2
ip route append default via $GW2 dev $DEV2 src $IP2 table $TABLE2
ip route append prohibit default table $TABLE2 metric 1 proto static
ip rule add prio 100 table 100
ip route add default table 100 proto static \
nexthop via $GW1 dev $DEV1 \
nexthop via $GW2 dev $DEV2
#ip rule add prio 200 table 200
#ip route append default via $GW1 dev $DEV1 src $IP1 table 200
#ip route append default via $GW2 dev $DEV2 src $IP2 table 200
}
status() {
ip route list table main
ip rule
}
stop() {
resetRoute
}
start() {
setRoute
}
case "$1" in
start)
echo "Starting loadbalancing"
start
;;
stop)
echo "Shutting down loadbalancing"
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo "Usage: $0 {start|stop|restart|status}"
exit 1
Utilisateur(s) parcourant actuellement ce forum : Aucun utilisateur inscrit et 1 invité