Help on routing
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix administration > Help on routing




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    Help on routing  
Martin Jeppesen


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
01-23-04 09:50 PM

Hi,

I have a network with 2 providers, and I want to split the traffic up in
two.

My problem is that when I tcpdump like this:
tcpdump -n -i eth1 net 192.168.44.0/24
I fetch packages that are not suppose to the routed to eth1=(

Can anyone please debug my routing script???

#!/bin/sh

IF1=eth1
IP1=192.168.43.2
P1=192.168.43.1
P1_NET=192.168.43.0/24
T1=adsl43

IF2=eth2
IP2=192.168.44.2
P2=192.168.44.1
P2_NET=192.168.44.0/24
T2=adsl44

IF0=eth0
P0_NET=172.20.0.0/16

IP=/sbin/ip

###
# Makes routing tables for packages from and to adslrouter
###
$IP route add $P1_NET dev $IF1 src $IP1 proto static table $T1
$IP route add default via $P1 proto static table $T1
$IP route add $P2_NET dev $IF2 src $IP2 proto static table $T2
$IP route add default via $P2 proto static table $T2

$IP route del $P1_NET
$IP route add $P1_NET dev $IF1 src $IP1 proto static
$IP route del $P2_NET
$IP route add $P2_NET dev $IF2 src $IP2 proto static

$IP rule add from $IP1 table $T1
$IP rule add from $IP2 table $T2

$IP route add $P0_NET dev $IF0 table $T1
$IP route add $P2_NET dev $IF2 table $T1
$IP route add $P0_NET dev $IF0 table $T2
$IP route add $P1_NET dev $IF1 table $T2

###
# Default route, share the traffic to the 2 adsl lines:
###

# Delete the old default route:
$IP route del default

# and make the new:
$IP route add default scope global nexthop via $P1 dev $IF1 weight 1 nexthop
 via $P2 dev $IF2 weight 1

#All traffic from mainserver to the Internet over adsl44 line:
$IP route add table mainserver $P1_NET dev $IF1
$IP route add table mainserver $P2_NET dev $IF2
$IP route add table mainserver default via $P2 dev $IF2
$IP rule add from 172.20.1.1 table mainserver

#Flush cache when there are changed rules:
$IP route flush cache

#Set the number of possible connections from 4096 to 16384:
/bin/echo 16384 > /proc/sys/net/ipv4/ip_conntrack_max






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 01:16 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register