zwei dsl leitungen ein router

lucderheld

Grünschnabel
Hallo,

ich habe vor eine Standleitung für VoIP zu meiner normalen DSL Leitung dazuzumieten. Nun möchte ich (da es eine günstige SDSL Leitung ist mit traffic beschränkung) den normalen Internetverkehr nur über ADSL laufen lassen und VoIP über SDSL. Wie sollte ich das Problem am besten angehen? Mit iptables unter linux? Oder gibt es Router zu kaufen die sowas können?

Ich stelle mir das so vor, dass ich einen Proxy-Server installiere der über die ADSL Leitung angebunden ist auf dem auch DHCP läuft und dann mit iptables einstelle das jeder internetverkehr ausser auf port 80 geblockt wird und weitergeleitet wird an das adsl interface. Alles was über die voip ports reinkommt, soll dann über das 2. interface weitergeleitet werden. Klappt das so wie ich mir das vorstelle?

grüße,
luc
 
ich habe nun folgendes herausgefunden:

Code:
Let us first set some symbolical names. Let $IF1 be the name of the first interface (if1 in the picture
above) and $IF2 the name of the second interface. Then let $IP1 be the IP address associated with $IF1
and $IP2 the IP address associated with $IF2. Next, let $P1 be the IP address of the gateway at Provider
1, and $P2 the IP address of the gateway at provider 2. Finally, let $P1_NET be the IP network $P1 is in,
and $P2_NET the IP network $P2 is in.
One creates two additional routing tables, say T1 and T2. These are added in /etc/iproute2/rt_tables.
Then you set up routing in these tables as follows:
ip route add $P1_NET dev $IF1 src $IP1 table T1
ip route add default via $P1 table T1
ip route add $P2_NET dev $IF2 src $IP2 table T2
ip route add default via $P2 table T2
Nothing spectacular, just build a route to the gateway and build a default route via that gateway, as you
would do in the case of a single upstream provider, but put the routes in a separate table per provider.
Note that the network route suffices, as it tells you how to find any host in that network, which includes
the gateway, as specified above.
Next you set up the main routing table. It is a good idea to route things to the direct neighbour through
the interface connected to that neighbour. Note the ‘src’ arguments, they make sure the right outgoing IP
address is chosen.
ip route add $P1_NET dev $IF1 src $IP1
ip route add $P2_NET dev $IF2 src $IP2

Then, your preference for default route:
ip route add default via $P1
Next, you set up the routing rules. These actually choose what routing table to route with. You want to
make sure that you route out a given interface if you already have the corresponding source address:
ip rule add from $IP1 table T1
ip rule add from $IP2 table T2

So nun habe ich zwei neue gateways. beispielsweise 192.168.0.1 und 192.168.1.1 nur wie geht es nun weiter? Ich kann ja immer nur einen gateway pro client setzen. Ich bin also da wo ich angefangen habe... Mache ich mir nun vielleicht ein 3. gateway in dem ich mit iptables entscheide wohin welche anfrage gestellt wird? keine ahnung...
 
Zurück