This is a discussion on 2 DSL connections and 1 ROUTER within the Linux Networking forums, part of the Linux Forums category; Hi, I need your appreciate Help. I have one linux box with 3.0 redhat and 3 network cards: eth0=...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Hi, I need your appreciate Help.
I have one linux box with 3.0 redhat and 3 network cards: eth0=10.0.0.1/24 ---- connected to private LAN eth1=192.168.10.1/24 ---- connected to router DSL1 (IP 192.168.10.2/24) eth2=192.168.20.1/24 ---- connected to router DSL2 (IP 192.128.20.2/24) I want the following: Range between 10.0.0.10 to 10.0.0.127 connect to Internet using DSL1 mask =/24 Range between 10.0.0.128 to 10.0.0.254 connect to Internet using DSL2. mask=/24 ¿How can I do that? ¿using iptables and iproute2? ¿any example? Thank you very much. |
|
|||
|
You jsut need some iptables stuff like this
iptables -A FORWARD -i eth0 -s 10.0.0.128/25 -o eth1 -j ACCEPT iptables -A FORWARD -i eth0 -s 10.0.0.0/25 -o eth2 -j ACCEPT to select your 2 netzone. Then add some iptables stuff like every firewall to do the policy you want. Cheers jvda Le Wed, 14 Jan 2004 22:27:54 +0100, Rafa a écrit*: > Hi, I need your appreciate Help. > > I have one linux box with 3.0 redhat and 3 network cards: > > eth0=10.0.0.1/24 ---- connected to private LAN > eth1=192.168.10.1/24 ---- connected to router DSL1 (IP > 192.168.10.2/24) > eth2=192.168.20.1/24 ---- connected to router DSL2 (IP > 192.128.20.2/24) > > > I want the following: > > Range between 10.0.0.10 to 10.0.0.127 connect to Internet using DSL1 mask > =/24 > Range between 10.0.0.128 to 10.0.0.254 connect to Internet using DSL2. > mask=/24 > > ¿How can I do that? > ¿using iptables and iproute2? > ¿any example? > > Thank you very much. |
|
|||
|
Rafa <rafa@este.correo.no.vale> wrote:
> Hi, I need your appreciate Help. > > I have one linux box with 3.0 redhat and 3 network cards: You mean to say you have a Redhat _3.0_ box? That's _very_ old. Perhaps you mean 8.0 or 9.0? > eth0=10.0.0.1/24 ---- connected to private LAN > eth1=192.168.10.1/24 ---- connected to router DSL1 (IP > 192.168.10.2/24) > eth2=192.168.20.1/24 ---- connected to router DSL2 (IP > 192.128.20.2/24) > > > I want the following: > > Range between 10.0.0.10 to 10.0.0.127 connect to Internet using DSL1 mask > =/24 Hmmm, this ones not very well designed (.10 is not a round number for this purpose) I would suggest changing it the lower end of the range from .10 to .15 (one less than 16), or higher (.31, .47, .63) If we change it to .16, we can allocate it like this, but note that it will be larger than the range. You can put in a more specific route entry to get the rang 10.0.0.0-15 pointing in the correct direction. route add -net 10.0.0.0/25 gw 192.168.10.2 #This one fixes 10.0.0.0-15. route add -net 10.0.0.0/28 $ ipsc -h 10.0.0.0/28 IP address: 10.0.0.0 Hexadecimal IP address: A000000 Address allocation range: 10.0.0.0 - 10.0.0.15 Full subnet mask: 255.255.255.240 Subnet mask: 0.255.255.240 Subnet ID: 0.0.0.0 Network ID: 10.0.0.0 Host ID: 0.0.0.0 route add -net 10.0.0.0/28 dev eth0 Because this route entry is more specific, it will be used in favour of the other ones > Range between 10.0.0.128 to 10.0.0.254 connect to Internet using DSL2. > mask=/24 You can represent that as a single block of 10.0.0.1/25 (note the mask) $ ipsc -h 10.0.0.128/25 IP address: 10.0.0.128 Hexadecimal IP address: A000080 Address allocation range: 10.0.0.128 - 10.0.0.255 Full subnet mask: 255.255.255.128 Subnet mask: 0.255.255.128 Subnet ID: 0.0.0.128 Network ID: 10.0.0.0 Host ID: 0.0.0.128 So you could use route add -net 10.0.0.128/25 gw 192.128.20.2 > ?using iptables and iproute2? I don't (yet) know iproute2 syntax, but you should be able to translate what I have shown without too much trouble. > Thank you very much. Your welcome, but know that I haven't tested this. PS. You are aware that 10.0.0.0 is custamarily a class A network, right? -- Cameron Kerr cameron.kerr@paradise.net.nz : http://nzgeeks.org/cameron/ Empowered by Perl! |
|
|||
|
Thanks.
I will try this configuration. I'm using Redhat 3.0 ES. I will post here my results. Thanks again. "Cameron Kerr" <cameron.kerr@paradise.net.nz> escribió en el mensaje news:4005da93@news.orcon.net.nz... > Rafa <rafa@este.correo.no.vale> wrote: > > Hi, I need your appreciate Help. > > > > I have one linux box with 3.0 redhat and 3 network cards: > > You mean to say you have a Redhat _3.0_ box? That's _very_ old. Perhaps > you mean 8.0 or 9.0? > > > eth0=10.0.0.1/24 ---- connected to private LAN > > eth1=192.168.10.1/24 ---- connected to router DSL1 (IP > > 192.168.10.2/24) > > eth2=192.168.20.1/24 ---- connected to router DSL2 (IP > > 192.128.20.2/24) > > > > > > I want the following: > > > > Range between 10.0.0.10 to 10.0.0.127 connect to Internet using DSL1 mask > > =/24 > > Hmmm, this ones not very well designed (.10 is not a round number for > this purpose) I would suggest changing it the lower end of the range > from .10 to .15 (one less than 16), or higher (.31, .47, .63) > > If we change it to .16, we can allocate it like this, but note that it > will be larger than the range. You can put in a more specific route > entry to get the rang 10.0.0.0-15 pointing in the correct direction. > > route add -net 10.0.0.0/25 gw 192.168.10.2 > > #This one fixes 10.0.0.0-15. > route add -net 10.0.0.0/28 > > $ ipsc -h 10.0.0.0/28 > IP address: 10.0.0.0 > Hexadecimal IP address: A000000 > Address allocation range: 10.0.0.0 - 10.0.0.15 > Full subnet mask: 255.255.255.240 > Subnet mask: 0.255.255.240 > Subnet ID: 0.0.0.0 > Network ID: 10.0.0.0 > Host ID: 0.0.0.0 > > route add -net 10.0.0.0/28 dev eth0 > > Because this route entry is more specific, it will be used in favour of > the other ones > > > Range between 10.0.0.128 to 10.0.0.254 connect to Internet using DSL2. > > mask=/24 > > You can represent that as a single block of 10.0.0.1/25 (note the mask) > > $ ipsc -h 10.0.0.128/25 > IP address: 10.0.0.128 > Hexadecimal IP address: A000080 > Address allocation range: 10.0.0.128 - 10.0.0.255 > Full subnet mask: 255.255.255.128 > Subnet mask: 0.255.255.128 > Subnet ID: 0.0.0.128 > Network ID: 10.0.0.0 > Host ID: 0.0.0.128 > > So you could use > > route add -net 10.0.0.128/25 gw 192.128.20.2 > > > ?using iptables and iproute2? > > I don't (yet) know iproute2 syntax, but you should be able to translate > what I have shown without too much trouble. > > > Thank you very much. > > Your welcome, but know that I haven't tested this. > > PS. You are aware that 10.0.0.0 is custamarily a class A network, right? > > -- > Cameron Kerr > cameron.kerr@paradise.net.nz : http://nzgeeks.org/cameron/ > Empowered by Perl! |
|
|||
|
Hi,
If you read the Advance Routing howto, chapter 4.2 gives something pretty cool http://www.tldp.org/HOWTO/Adv-Routin...ple-links.html describing how you can use both links in loadbalancing. it works. goodluck, Jan "Rafa" <rafa@este.correo.no.vale> wrote in message news:bu4c8r$cq875@cesio.mundo-r.com... > Hi, I need your appreciate Help. > > I have one linux box with 3.0 redhat and 3 network cards: > > eth0=10.0.0.1/24 ---- connected to private LAN > eth1=192.168.10.1/24 ---- connected to router DSL1 (IP > 192.168.10.2/24) > eth2=192.168.20.1/24 ---- connected to router DSL2 (IP > 192.128.20.2/24) > > > I want the following: > > Range between 10.0.0.10 to 10.0.0.127 connect to Internet using DSL1 mask > =/24 > Range between 10.0.0.128 to 10.0.0.254 connect to Internet using DSL2. > mask=/24 > > ¿How can I do that? > ¿using iptables and iproute2? > ¿any example? > > Thank you very much. > > > > |