* [LARTC] two providers.
@ 2007-08-16 11:48 Виталий Цховребов
2007-08-16 15:25 ` goblin
` (3 more replies)
0 siblings, 4 replies; 11+ messages in thread
From: Виталий Цховребов @ 2007-08-16 11:48 UTC (permalink / raw)
To: lartc
Hello, people.
I read iptables tutorial and lartc, but i'm still confused with one
trouble.
May be this question was discussed already, so forward me solution, if
is.
So, there's a trouble.
I have debian etch linux. 2.6.18-4 kernel.
On this computer i have three interfaces: eth0 - my lan, eth1, eth2 -
providers.
By default all internet traffic routed through eth2. But i NEED to
route mail and icq (tcp110, tcp25, tcp5190) through eth1. How can i do that?
Regards, Vitaliy Tskhovrebov.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] two providers.
2007-08-16 11:48 [LARTC] two providers Виталий Цховребов
@ 2007-08-16 15:25 ` goblin
2007-08-17 4:57 ` Indunil Jayasooriya
` (2 subsequent siblings)
3 siblings, 0 replies; 11+ messages in thread
From: goblin @ 2007-08-16 15:25 UTC (permalink / raw)
To: lartc
> So, there's a trouble.
>
> I have debian etch linux. 2.6.18-4 kernel.
>
> On this computer i have three interfaces: eth0 - my lan, eth1, eth2 -
> providers.
>
> By default all internet traffic routed through eth2. But i NEED to
> route mail and icq (tcp110, tcp25, tcp5190) through eth1. How can i do
> that?
A while ago ive used a similar configuration, what ive done was:
- create additionall routing table
add all regular entries to it with changed default gateway for the second provider like:
ip route add xxx.xxx.xxx.xxx via yyy.yyy.yyy.yyy table 2
...
ip route add default via IP_OF_2ND_GATEWAY table 2
- mark desired traffic with iptables
iptables -I FORWARD -s LAN_NET/MASK -p tcp --dport XXX -j MARK --set-mark 2
- use ip rules to direct marked packets via alternative routing table
ip rule add fwmark 2 table 2
- and maby add additionall rule to make all packages originating at eth1 ip to go via table 2
ip rule add from ETH1_IP table 2
should be more or less something like this, though i dont recall if syntax was exactly like ive wrote above.
big dissadvantage of this solution is utilisation of marks, that might be used for another purpose.
--
Radek 'Goblin' Pieczonka
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] two providers.
2007-08-16 11:48 [LARTC] two providers Виталий Цховребов
2007-08-16 15:25 ` goblin
@ 2007-08-17 4:57 ` Indunil Jayasooriya
2007-08-18 4:50 ` Mikhail
2007-08-18 6:23 ` Виталий Цховребов
3 siblings, 0 replies; 11+ messages in thread
From: Indunil Jayasooriya @ 2007-08-17 4:57 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 2939 bytes --]
On 8/16/07, Виталий Цховребов <mitnlag@yandex.ru> wrote:
>
> Hello, people.
>
> I read iptables tutorial and lartc, but i'm still confused with one
> trouble.
>
> May be this question was discussed already, so forward me solution, if
> is.
>
> So, there's a trouble.
>
> I have debian etch linux. 2.6.18-4 kernel.
>
> On this computer i have three interfaces: eth0 - my lan, eth1, eth2 -
> providers.
>
> By default all internet traffic routed through eth2. But i NEED to
> route mail and icq (tcp110, tcp25, tcp5190) through eth1. How can i do
> that?
That is policy routing.
Is it a SNATed firewall? I use below script for a SNATed firewall where I
have two links such as a Leasedline and a ADSL. I route web traffic (both
HTTP and HTTPS -- port tcp 80 and tcp 443) via ADSL link.
YOU want to route mail and icq (tcp110, tcp25, tcp5190) through eth1. pls
change your ports accordinly.
Pls replace gatewayipofprovider1, gatewayipofprovider2, ipofETH1 and
ipofETH2 with yours.
by default, My firewall also routes trafic via eth2 (i.e-
gatewayipofprovider1---
Leasedline or realiplink ) I route http and https traffic via eth1
(i.e- gatewayipofprovider2
--ADSL or adsllink ) .
in your case, it is the SAME.
below is the Script.
echo 210 realiplink >> /etc/iproute2/rt_tables
echo 211 adsllink >> /etc/iproute2/rt_tables
ip route add <http://203.115.26.65/>gatewayipofprovider1 dev eth2 table
realiplink
ip route add default via gatewayipofprovider1 dev eth2 table realiplink
ip route add gatewayipofprovider2 dev eth1 table adsllink
ip route add default via gatewayipofprovider2 dev eth1 table adsllink
iptables -t mangle -A OUTPUT -p tcp -m multiport --dports 80,443 -j MARK
--set-mark 1
ip rule add fwmark 1 pri 100 table adsllink
iptables -t nat -A POSTROUTING -o eth1 -j SNAT --to-source ipofETH1
echo 0 > /proc/sys/net/ipv4/conf/eth1/rp_filter
ip rule add from ipofETH2 pri 200 table realiplink
ip rule add from ipofETH1 pri 300 table adsllink
Then, issue below command to see routing tables
ip rule list
PLS NOTE:
In the above script, I have marked OUTPUT trafic as 1. below is the command
I have given
iptables -t mangle -A OUTPUT -p tcp -m multiport --dports 80,443 -j MARK
--set-mark 1
the reason for that is the firewall is itself is a SQUID proxy server. But
not a TRANSPARENT PROXY.
Just acts as a normal proxy. (i.e- I have configured client browsers with ip
address and port 3128.)
Try with the above script and see if it works. UNLESS it works, pls replace
the above command with this.
iptables -t mangle -A PREROUTING -p tcp -m multiport --dports 80,443 -j MARK
--set-mark 1
or
iptables -t mangle -A PREROUTING -i eth0 -p tcp -m multiport --dports 80,443
-j MARK --set-mark 1
try this nad be HAPPY
_______________________________________________
> LARTC mailing list
> LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
>
--
Thank you
Indunil Jayasooriya
[-- Attachment #1.2: Type: text/html, Size: 5178 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* [LARTC] two providers.
2007-08-16 11:48 [LARTC] two providers Виталий Цховребов
2007-08-16 15:25 ` goblin
2007-08-17 4:57 ` Indunil Jayasooriya
@ 2007-08-18 4:50 ` Mikhail
2007-08-18 6:23 ` Виталий Цховребов
3 siblings, 0 replies; 11+ messages in thread
From: Mikhail @ 2007-08-18 4:50 UTC (permalink / raw)
To: lartc
One solution would be to mark outbound packets using iptables and then route
them based on the marks.
> Hello, people.
>
> I read iptables tutorial and lartc, but i'm still confused with one
> trouble.
>
> May be this question was discussed already, so forward me solution, if
> is.
>
> So, there's a trouble.
>
> I have debian etch linux. 2.6.18-4 kernel.
>
> On this computer i have three interfaces: eth0 - my lan, eth1, eth2 -
> providers.
>
> By default all internet traffic routed through eth2. But i NEED to
> route mail and icq (tcp110, tcp25, tcp5190) through eth1. How can i do
> that?
>
> Regards, Vitaliy Tskhovrebov.
>
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] two providers.
2007-08-16 11:48 [LARTC] two providers Виталий Цховребов
` (2 preceding siblings ...)
2007-08-18 4:50 ` Mikhail
@ 2007-08-18 6:23 ` Виталий Цховребов
3 siblings, 0 replies; 11+ messages in thread
From: Виталий Цховребов @ 2007-08-18 6:23 UTC (permalink / raw)
To: lartc
Thanks all who help me, i'll try solutions soon, and i'll write to the
list.
--
С уважением,
Виталий mailto:mitnlag@yandex.ru
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
^ permalink raw reply [flat|nested] 11+ messages in thread
* [LARTC] two providers
@ 2007-08-21 8:07 mangal regmi
2007-08-21 8:54 ` Indunil Jayasooriya
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: mangal regmi @ 2007-08-21 8:07 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 2145 bytes --]
Hi to all
i think this is not a new problem for this forum....but its newest for me as i m a new linux lerner. Even if it is new plzz....reply me ur answer..n if its already asked n have solution..plzz forward the solution. My problem is here mentioned:
I have fedora core 4 as a linux server. there r two external links connected to this.
the settings are as: eth0 ->for internal (that is for LAN)
eth2 ->dsl connection
eth1 ->cable line connection( this connection has no gateway and netmask address provided so this is connected via ppp0. this is provided from ISP via DHCP but have the fixed ipaddress)
i want to use these two link to provide the internet in my LAN where there are about 8 to 10 computers. i want that if any of the link goes down ...the other should continue the internet ...n also while both the links r up..the load should be shared between these two links....so that the net conection and downloads be faster....
i have heard about the scripts....that can do this....but i have no idea how to write these...scripts. i need these to be on after reboot also...
i tried my best and i also refered the lartc.org ..but i could do a little only.
WHAT I DID: it works very well if i connect both of the links and the default path is via ppp0. but suppose if that is(ppp0) disconnected then the dsl connection can handle only upto 15/16 seconds. after that it disconnects . whats the solution ...plzz...as..soon as..possible...help..me...i m in big trouble....
UR SMALL HELP WILL BE A BIG BOON FOR ME
Remember that i don't have gateway and netmask of eth1 connection. it has ip address only.it is NATed via ppp0. and also my all working are based on lartc.org only...in case of dsl connection i have just replaced the ip and gateways with my ip and gateways....n in case of ppp0 conection i have put ppp0 in the place of gateway n netmask and in place of ip i have given the ip of that link.
THANKS IN ADVANCE
---------------------------------
Luggage? GPS? Comic books?
Check out fitting gifts for grads at Yahoo! Search.
[-- Attachment #1.2: Type: text/html, Size: 2574 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] two providers
2007-08-21 8:07 mangal regmi
@ 2007-08-21 8:54 ` Indunil Jayasooriya
2007-08-21 10:43 ` mangal regmi
` (3 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Indunil Jayasooriya @ 2007-08-21 8:54 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 3653 bytes --]
On 8/21/07, mangal regmi <mangalregmi@yahoo.com> wrote:
>
> Hi to all
> i think this is not a new problem for this forum....but its newest for me
> as i m a new linux lerner. Even if it is new plzz....reply me ur answer..n
> if its already asked n have solution..plzz forward the solution. My problem
> is here mentioned:
> I have fedora core 4 as a linux server. there r two external links
> connected to this.
I there are 2 external links, What is the file /etc/sysconfig/network like?
Can you witre down the file?
the settings are as: eth0 ->for internal (that is for LAN)
> eth2 ->dsl connection
> eth1 ->cable line connection( this connection
> has no gateway and netmask address provided so this is connected via ppp0.
> this is provided from ISP via DHCP but have the fixed ipaddress) Hey, What
> is this FIXED ip address? Is it a perment address?
>
YOUR eth0 of Fedora Server is for internal (that is for LAN)
YOUR eth2 of Fedora Server is connected to the dsl connection.
YOUR eth1 of Fedora Server is connected to the cable line connection. It has
a ip.
i want to use these two link to provide the internet in my LAN where there
> are about 8 to 10 computers. i want that if any of the link goes down ...the
> other should continue the internet ...n also while both the links r up..the
> load should be shared between these two links....so that the net conection
> and downloads be faster....
>
> i have heard about the scripts....that can do this....but i have no idea
> how to write these...scripts. i need these to be on after reboot also...
To come up the script after the reboot, There are two ways. Either you have
to write everytning IN /etc/rc.d/rc.local or write the script as a seperate
file and and make it executable by using chmod.
Pls see bellow.
first create the file as follows.
touch /etc/rc.d/loadbalancing
then , By using vi editor write the script and save it as usual. Then , Make
it executable as follows.
chmod 755 /etc/rc.d/loadbalancing
and finally add PATH OF THE SCRIPT to /etc/rc.d/rc.local file as follows.
etc/rc.d/loadbalancing
That's it. Now, whenever you reboot the system, the scripts also comes up
with the system.
i tried my best and i also refered the lartc.org ..but i could do a little
> only.
>
> WHAT I DID: it works very well if i connect both of the links and the
> default path is via ppp0. but suppose if that is(ppp0) disconnected then
> the dsl connection can handle only upto 15/16 seconds. after that it
> disconnects . whats the solution ...plzz...as..soon
> as..possible...help..me...i m in big trouble....
> UR SMALL HELP WILL BE A BIG BOON FOR ME
COULD YOU PLS write down your RULES . then, I will be able to help you.
Remember that i don't have gateway and netmask of eth1 connection. it has
> ip address only.it is NATed via ppp0. and also my all working are based on
> lartc.org only...in case of dsl connection i have just replaced the ip and
> gateways with my ip and gateways....n in case of ppp0 conection i have put
> ppp0 in the place of gateway n netmask and in place of ip i have given the
> ip of that link.
The above paragraph is not so clear.
THANKS IN ADVANCE
>
> ------------------------------
> Luggage? GPS? Comic books?
> Check out fitting gifts for grads<http://us.rd.yahoo.com/evt=48249/*http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz>at Yahoo! Search.
>
>
> _______________________________________________
> LARTC mailing list
> LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
>
>
--
Thank you
Indunil Jayasooriya
[-- Attachment #1.2: Type: text/html, Size: 6346 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* [LARTC] two providers
2007-08-21 8:07 mangal regmi
2007-08-21 8:54 ` Indunil Jayasooriya
@ 2007-08-21 10:43 ` mangal regmi
2007-08-21 11:23 ` Indunil Jayasooriya
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: mangal regmi @ 2007-08-21 10:43 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 2147 bytes --]
many many thanks for ur help
ok i m making my problem more clear...
my LAN ip is :172.16.100.0/24
ip of eth1 is :202.51.78.122 and this is fixed and permanent address
and it has no netmask and gateway(so, to provide internet to my LAN i have used the ppp0 for this connection )
ip of eth2 : 203.78.165.154; netmask:255.255.255.248; gateway:203.78.165.153
for eth0 my file is :/etc/sysconfig/network-scripts/ifcfg-eth0
for eth1 :/etc/sysconfig/network-scripts/ifcfg-eth1
for eth2:/etc/sysconfig/network-scripts/ifcfg-eth2
and my rules are placed in /etc/iproute2/rt_tables as suggested by lartc.org
and the whole copy of my above file is copied below:::>>>
#
# reserved values
#
#255 local
#254 main
#253 default
#0 unspec
#
# local
#
#1 inr.ruhep
#
# below this is added by me and above this is by default
# two addational routing tables
#ip route add 202.51.78.0/24 dev eth1 src ppp0 table T1
#ip route add default via ppp0 table T1
ip route add 203.78.165.0/24 dev eth2 src 203.78.165.154 table T2
ip route add default via 203.78.165.153 table T2
# main routing table
ip route add 202.51.78.0/24 dev eth1 src ppp0
ip route add 203.78.165.0/24 dev src 203.78.165.154
# preference for default route
ip route add default via 202.51.76.122
# routing rules
ip rule add from ppp0 table T1
ip rule add from 203.78.165.154 table T2
# entries for local network
ip route add 172.16.100.0/24 dev eth0 table T1
ip route add 203.78.165.0/24 dev eth2 table T1
ip route add 127.0.0.0/8 dev lo table T1
ip route add 172.16.100.0/24 dev eth0 table T2
ip route add 202.51.78.0/24 dev eth1 table T2
ip route add 127.0.0.0/8 dev lo table T2
#load balancing
ip route add default scope global nexthop via ppp0 dev eth1 weight 1 nexthop via 203.78.165.153 dev eth2 weight 1
this above one is the full and exact copy of my working....
---------------------------------
Take the Internet to Go: Yahoo!Go puts the Internet in your pocket: mail, news, photos & more.
[-- Attachment #1.2: Type: text/html, Size: 2785 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] two providers
2007-08-21 8:07 mangal regmi
2007-08-21 8:54 ` Indunil Jayasooriya
2007-08-21 10:43 ` mangal regmi
@ 2007-08-21 11:23 ` Indunil Jayasooriya
2007-08-21 11:31 ` Salim S I
2007-08-22 4:16 ` Indunil Jayasooriya
4 siblings, 0 replies; 11+ messages in thread
From: Indunil Jayasooriya @ 2007-08-21 11:23 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 7031 bytes --]
Pls either DELETE your script or save it somewhere else.
and Now, replace your script with this.
AND TRY, if it works.
this is the script.
echo "11 T1" >> /etc/iproute2/rt_tables
echo "12 T2" >> /etc/iproute2/rt_tables
ip route add 202.51.78.0/24 dev eth1 src 202.51.78.122 table T1
ip route add default via ppp0 table T1
ip route add 203.78.165.0/29 <http://203.78.165.0/24> dev eth2 src
203.78.165.154 table T2
ip route add default via 203.78.165.153 table T2
* ip rule add from *202.51.78.122 *table T1
ip rule add from 203.78.165.154 table T2*
ip route add default scope global nexthop via 202.51.78.122 dev eth1 weight
1 nexthop via 203.78.165.153 dev eth2 weight 1
THAT'S it. try and let me know.
N-JOY IPROUTE2
On 8/21/07, mangal regmi <mangalregmi@yahoo.com> wrote:
>
> many many thanks for ur help
> ok i m making my problem more clear...
>
> my LAN ip is :172.16.100.0/24
> ip of eth1 is :202.51.78.122 and this is fixed and permanent address
> and it has no netmask and gateway(so, to provide internet
> to my LAN i have used the ppp0 for this connection )
> ip of eth2 : 203.78.165.154; netmask:255.255.255.248; gateway:
> 203.78.165.153
>
> for eth0 my file is :/etc/sysconfig/network-scripts/ifcfg-eth0
> for eth1 :/etc/sysconfig/network-scripts/ifcfg-eth1
> for eth2:/etc/sysconfig/network-scripts/ifcfg-eth2
>
> and my rules are placed in /etc/iproute2/rt_tables as suggested by
> lartc.org
>
> and the whole copy of my above file is copied below:::>>>
>
>
> #
> # reserved values
> #
> #255 local
> #254 main
> #253 default
> #0 unspec
> #
> # local
> #
> #1 inr.ruhep
>
> #
> # below this is added by me and above this is by default
> # two addational routing tables
>
> #ip route add 202.51.78.0/24 dev eth1 src ppp0 table T1
> #ip route add default via ppp0 table T1
> ip route add 203.78.165.0/24 dev eth2 src 203.78.165.154 table T2
> ip route add default via 203.78.165.153 table T2
>
> # main routing table
>
> *ip route add 202.51.78.0/24 dev eth1 src ppp0
> ip route add 203.78.165.0/24 dev src 203.78.165.154
>
> # preference for default route
>
> ip route add default via 202.51.76.122
>
> # routing rules
>
> ip rule add from ppp0 table T1
> ip rule add from 203.78.165.154 table T2
>
> # entries for local network
>
> ip route add 172.16.100.0/24 dev eth0 table T1
> ip route add 203.78.165.0/24 dev eth2 table T1
> ip route add 127.0.0.0/8 dev lo table T1
> ip route add 172.16.100.0/24 dev eth0 table T2
> ip route add 202.51.78.0/24 dev eth1 table T2
> ip route add 127.0.0.0/8 dev lo table T2
>
> #load balancing
> ip route add default scope global nexthop via ppp0 dev eth1 weight 1
> nexthop via 203.78.165.153 dev eth2 weight 1
>
> this above one is the full and exact copy of my working....
>
>
>
>
> Indunil Jayasooriya <indunil75@gmail.com>
> * wrote:
>
>
>
> On 8/21/07, mangal regmi <mangalregmi@yahoo.com> wrote:
> >
> > Hi to all
> > i think this is not a new problem for this forum....but its newest for
> > me as i m a new linux lerner. Even if it is new plzz....reply me ur
> > answer..n if its already asked n have solution..plzz forward the solution.
> > My problem is here mentioned:
> > I have fedora core 4 as a linux server. there r two external links
> > connected to this.
>
>
> I there are 2 external links, What is the file /etc/sysconfig/networklike?
>
> Can you witre down the file?
>
>
> the settings are as: eth0 ->for internal (that is for LAN)
> > eth2 ->dsl connection
> > eth1 ->cable line connection( this
> > connection has no gateway and netmask address provided so this is connected
> > via ppp0. this is provided from ISP via DHCP but have the fixed ipaddress)
> > Hey, What is this FIXED ip address? Is it a perment address?
> >
>
> YOUR eth0 of Fedora Server is for internal (that is for LAN)
> YOUR eth2 of Fedora Server is connected to the dsl connection.
> YOUR eth1 of Fedora Server is connected to the cable line connection. It
> has a ip.
>
>
> i want to use these two link to provide the internet in my LAN where there
> > are about 8 to 10 computers. i want that if any of the link goes down ...the
> > other should continue the internet ...n also while both the links r up..the
> > load should be shared between these two links....so that the net conection
> > and downloads be faster....
> >
> > i have heard about the scripts....that can do this....but i have no idea
> > how to write these...scripts. i need these to be on after reboot also...
>
>
> To come up the script after the reboot, There are two ways. Either you
> have to write everytning IN /etc/rc.d/rc.local or write the script as a
> seperate file and and make it executable by using chmod.
>
> Pls see bellow.
>
> first create the file as follows.
>
> touch /etc/rc.d/loadbalancing
>
> then , By using vi editor write the script and save it as usual. Then ,
> Make it executable as follows.
>
> chmod 755 /etc/rc.d/loadbalancing
>
> and finally add PATH OF THE SCRIPT to /etc/rc.d/rc.local file as follows.
>
> etc/rc.d/loadbalancing
>
> That's it. Now, whenever you reboot the system, the scripts also comes up
> with the system.
>
>
>
> i tried my best and i also refered the lartc.org ..but i could do a little
> > only.
> >
> > WHAT I DID: it works very well if i connect both of the links and the
> > default path is via ppp0. but suppose if that is(ppp0) disconnected then
> > the dsl connection can handle only upto 15/16 seconds. after that it
> > disconnects . whats the solution ...plzz...as..soon
> > as..possible...help..me...i m in big trouble....
> > UR SMALL HELP WILL BE A BIG BOON FOR ME
>
>
>
> COULD YOU PLS write down your RULES . then, I will be able to help you.
>
>
> Remember that i don't have gateway and netmask of eth1 connection. it has
> > ip address only.it is NATed via ppp0. and also my all working are based
> > on lartc.org only...in case of dsl connection i have just replaced the
> > ip and gateways with my ip and gateways....n in case of ppp0 conection i
> > have put ppp0 in the place of gateway n netmask and in place of ip i have
> > given the ip of that link.
>
>
> The above paragraph is not so clear.
>
>
> THANKS IN ADVANCE
> > ------------------------------
> > Luggage? GPS? Comic books?
> > Check out fitting gifts for grads
> > <http://us.rd.yahoo.com/evt=48249/*http://search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz>at Yahoo! Search.
> >
> > _______________________________________________
> > LARTC mailing list
> > LARTC@mailman.ds9a.nl
> > http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
> >
> >
>
>
> --
> Thank you
> Indunil Jayasooriya
>
>
> ------------------------------
> Choose the right car based on your needs. Check out Yahoo! Autos new Car
> Finder tool.<http://us.rd.yahoo.com/evt=48518/*http://autos.yahoo.com/carfinder/;_ylc=X3oDMTE3NWsyMDd2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDY2FyLWZpbmRlcg--+>
>
>
--
Thank you
Indunil Jayasooriya
[-- Attachment #1.2: Type: text/html, Size: 14527 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* RE: [LARTC] two providers
2007-08-21 8:07 mangal regmi
` (2 preceding siblings ...)
2007-08-21 11:23 ` Indunil Jayasooriya
@ 2007-08-21 11:31 ` Salim S I
2007-08-22 4:16 ` Indunil Jayasooriya
4 siblings, 0 replies; 11+ messages in thread
From: Salim S I @ 2007-08-21 11:31 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 7313 bytes --]
> "ip route add default via ppp0 table T1"
via is not for device name.
After ppp0 is up, type ifconfig and see the gateway,and use that
gateway.
-----Original Message-----
From: lartc-bounces@mailman.ds9a.nl
[mailto:lartc-bounces@mailman.ds9a.nl] On Behalf Of Indunil Jayasooriya
Sent: Tuesday, August 21, 2007 7:12 PM
To: mangal regmi; lartc@mailman.ds9a.nl
Subject: Re: [LARTC] two providers
Pls either DELETE your script or save it somewhere else.
and Now, replace your script with this.
AND TRY, if it works.
this is the script.
echo "11 T1" >> /etc/iproute2/ rt_tables
echo "12 T2" >> /etc/iproute2/rt_tables
ip route add 202.51.78.0/24 dev eth1 src 202.51.78.122
<http://202.51.78.122/> table T1
ip route add default via ppp0 table T1
ip route add 203.78.165.0/29 <http://203.78.165.0/24> dev eth2 src
203.78.165.154 <http://203.78.165.154/> table T2
ip route add default via 203.78.165.153 <http://203.78.165.153/> table
T2
ip rule add from 202.51.78.122 <http://202.51.78.122/> table T1
ip rule add from 203.78.165.154 <http://203.78.165.154/> table T2
ip route add default scope global nexthop via 202.51.78.122
<http://202.51.78.122/> dev eth1 weight 1 nexthop via 203.78.165.153
<http://203.78.165.153/> dev eth2 weight 1
THAT'S it. try and let me know.
N-JOY IPROUTE2
On 8/21/07, mangal regmi <mangalregmi@yahoo.com> wrote:
many many thanks for ur help
ok i m making my problem more clear...
my LAN ip is :172.16.100.0/24
ip of eth1 is :202.51.78.122 and this is fixed and permanent address
and it has no netmask and gateway(so, to provide
internet to my LAN i have used the ppp0 for this connection )
ip of eth2 : 203.78.165.154; netmask: 255.255.255.248
<http://255.255.255.248> ; gateway:203.78.165.153
for eth0 my file is :/etc/sysconfig/network-scripts/ifcfg-eth0
for eth1 :/etc/sysconfig/network-scripts/ifcfg-eth1
for eth2:/etc/sysconfig/network-scripts/ifcfg-eth2
and my rules are placed in /etc/iproute2/rt_tables as suggested by
lartc.org
and the whole copy of my above file is copied below:::>>>
#
# reserved values
#
#255 local
#254 main
#253 default
#0 unspec
#
# local
#
#1 inr.ruhep
#
# below this is added by me and above this is by default
# two addational routing tables
#ip route add 202.51.78.0/24 dev eth1 src ppp0 table T1
#ip route add default via ppp0 table T1
ip route add 203.78.165.0/24 <http://203.78.165.0/24> dev eth2 src
203.78.165.154 table T2
ip route add default via 203.78.165.153 table T2
# main routing table
ip route add 202.51.78.0/24 dev eth1 src ppp0
ip route add 203.78.165.0/24 dev src 203.78.165.154
# preference for default route
ip route add default via 202.51.76.122
# routing rules
ip rule add from ppp0 table T1
ip rule add from 203.78.165.154 table T2
# entries for local network
ip route add 172.16.100.0/24 dev eth0 table T1
ip route add 203.78.165.0/24 dev eth2 table T1
ip route add 127.0.0.0/8 dev lo table T1
ip route add 172.16.100.0/24 dev eth0 table T2
ip route add 202.51.78.0/24 dev eth1 table T2
ip route add 127.0.0.0/8 dev lo table T2
#load balancing
ip route add default scope global nexthop via ppp0 dev eth1 weight 1
nexthop via 203.78.165.153 dev eth2 weight 1
this above one is the full and exact copy of my working....
Indunil Jayasooriya < <mailto:indunil75@gmail.com> indunil75@gmail.com>
wrote:
On 8/21/07, mangal regmi <mangalregmi@yahoo.com> wrote:
Hi to all
i think this is not a new problem for this forum....but its newest for
me as i m a new linux lerner. Even if it is new plzz....reply me ur
answer..n if its already asked n have solution..plzz forward the
solution. My problem is here mentioned:
I have fedora core 4 as a linux server. there r two external links
connected to this.
I there are 2 external links, What is the file /etc/sysconfig/network
like?
Can you witre down the file?
the settings are as: eth0 ->for internal (that is for LAN)
eth2 ->dsl connection
eth1 ->cable line connection( this
connection has no gateway and netmask address provided so this is
connected via ppp0. this is provided from ISP via DHCP but have the
fixed ipaddress) Hey, What is this FIXED ip address? Is it a perment
address?
YOUR eth0 of Fedora Server is for internal (that is for LAN)
YOUR eth2 of Fedora Server is connected to the dsl connection.
YOUR eth1 of Fedora Server is connected to the cable line connection. It
has a ip.
i want to use these two link to provide the internet in my LAN where
there are about 8 to 10 computers. i want that if any of the link goes
down ...the other should continue the internet ...n also while both the
links r up..the load should be shared between these two links....so
that the net conection and downloads be faster....
i have heard about the scripts....that can do this....but i have no idea
how to write these...scripts. i need these to be on after reboot
also...
To come up the script after the reboot, There are two ways. Either you
have to write everytning IN /etc/rc.d/rc.local or write the script as a
seperate file and and make it executable by using chmod.
Pls see bellow.
first create the file as follows.
touch /etc/rc.d/loadbalancing
then , By using vi editor write the script and save it as usual. Then ,
Make it executable as follows.
chmod 755 /etc/rc.d/loadbalancing
and finally add PATH OF THE SCRIPT to /etc/rc.d/rc.local file as
follows.
etc/rc.d/loadbalancing
That's it. Now, whenever you reboot the system, the scripts also comes
up with the system.
i tried my best and i also refered the lartc.org ..but i could do a
little only.
WHAT I DID: it works very well if i connect both of the links and the
default path is via ppp0. but suppose if that is(ppp0) disconnected
then the dsl connection can handle only upto 15/16 seconds. after that
it disconnects . whats the solution ...plzz...as..soon
as..possible...help..me...i m in big trouble....
UR SMALL HELP WILL BE A BIG BOON FOR ME
COULD YOU PLS write down your RULES . then, I will be able to help you.
Remember that i don't have gateway and netmask of eth1 connection. it
has ip address only.it is NATed via ppp0. and also my all working are
based on lartc.org only...in case of dsl connection i have just replaced
the ip and gateways with my ip and gateways....n in case of ppp0
conection i have put ppp0 in the place of gateway n netmask and in
place of ip i have given the ip of that link.
The above paragraph is not so clear.
THANKS IN ADVANCE
_____
Luggage? GPS? Comic books?
Check out fitting gifts
<http://us.rd.yahoo.com/evt=48249/*http:/search.yahoo.com/search?fr=oni_
on_mail&p=graduation+gifts&cs=bz> for grads at Yahoo! Search.
_______________________________________________
LARTC mailing list
LARTC@mailman.ds9a.nl <mailto:LARTC@mailman.ds9a.nl>
http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
--
Thank you
Indunil Jayasooriya
_____
Choose the right car based on your needs. Check out Yahoo!
<http://us.rd.yahoo.com/evt=48518/*http:/autos.yahoo.com/carfinder/;_ylc
=X3oDMTE3NWsyMDd2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDY2FyLWZpbmRlcg-
-+> Autos new Car Finder tool.
--
Thank you
Indunil Jayasooriya
[-- Attachment #1.2: Type: text/html, Size: 24922 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
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [LARTC] two providers
2007-08-21 8:07 mangal regmi
` (3 preceding siblings ...)
2007-08-21 11:31 ` Salim S I
@ 2007-08-22 4:16 ` Indunil Jayasooriya
4 siblings, 0 replies; 11+ messages in thread
From: Indunil Jayasooriya @ 2007-08-22 4:16 UTC (permalink / raw)
To: lartc
[-- Attachment #1.1: Type: text/plain, Size: 8030 bytes --]
On 8/21/07, Salim S I <salim.si@cipherium.com.tw> wrote:
>
> > "ip route add default via ppp0 table T1"
>
>
>
> via is not for device name.
>
YES, THAT'S right. Small error. pls forgive me.
After ppp0 is up, type ifconfig and see the gateway,and use that gateway.
>
YES, that is right. Pls DO it.
And also , Pls let me rectify the below rule as well
pls pay attnetion to ipaddressofppp0 written in BOLD letters. in the script
, I have used the ip address of eth1 (i.e- 202.51.78.122). pls replace that
rule with the below rule.
ip route add default scope global nexthop via ipaddressoppp0 dev eth1 weight
1 nexthop via 203.78.165.153 dev eth2 weight 1
-----Original Message-----
> *From:* lartc-bounces@mailman.ds9a.nl [mailto:
> lartc-bounces@mailman.ds9a.nl] *On Behalf Of *Indunil Jayasooriya
> *Sent:* Tuesday, August 21, 2007 7:12 PM
> *To:* mangal regmi; lartc@mailman.ds9a.nl
> *Subject:* Re: [LARTC] two providers
>
>
>
>
> Pls either DELETE your script or save it somewhere else.
>
> and Now, replace your script with this.
>
> AND TRY, if it works.
>
> this is the script.
>
>
> echo "11 T1" >> /etc/iproute2/ rt_tables
> echo "12 T2" >> /etc/iproute2/rt_tables
>
>
> ip route add 202.51.78.0/24 dev eth1 src 202.51.78.122 table T1
> ip route add default via ppp0 table T1
> ip route add 203.78.165.0/29 <http://203.78.165.0/24> dev eth2 src
> 203.78.165.154 table T2
> ip route add default via 203.78.165.153 table T2
>
> *ip rule add from *202.51.78.122 *table T1
> ip rule add from 203.78.165.154 table T2*
>
>
> ip route add default scope global nexthop via 202.51.78.122 dev eth1
> weight 1 nexthop via 203.78.165.153 dev eth2 weight 1
>
>
>
> THAT'S it. try and let me know.
>
> N-JOY IPROUTE2
>
>
>
>
> On 8/21/07, *mangal regmi* <mangalregmi@yahoo.com> wrote:
>
> many many thanks for ur help
> ok i m making my problem more clear...
>
> my LAN ip is :172.16.100.0/24
> ip of eth1 is :202.51.78.122 and this is fixed and permanent address
> and it has no netmask and gateway(so, to provide internet
> to my LAN i have used the ppp0 for this connection )
> ip of eth2 : 203.78.165.154; netmask: 255.255.255.248; gateway:
> 203.78.165.153
>
> for eth0 my file is :/etc/sysconfig/network-scripts/ifcfg-eth0
> for eth1 :/etc/sysconfig/network-scripts/ifcfg-eth1
> for eth2:/etc/sysconfig/network-scripts/ifcfg-eth2
>
> and my rules are placed in /etc/iproute2/rt_tables as suggested by
> lartc.org
>
> and the whole copy of my above file is copied below:::>>>
>
>
> #
> # reserved values
> #
> #255 local
> #254 main
> #253 default
> #0 unspec
> #
> # local
> #
> #1 inr.ruhep
>
> #
> # below this is added by me and above this is by default
> # two addational routing tables
>
> #ip route add 202.51.78.0/24 dev eth1 src ppp0 table T1
> #ip route add default via ppp0 table T1
> ip route add 203.78.165.0/24 dev eth2 src 203.78.165.154 table T2
> ip route add default via 203.78.165.153 table T2
>
> # main routing table
>
> *ip route add 202.51.78.0/24 dev eth1 src ppp0
> ip route add 203.78.165.0/24 dev src 203.78.165.154
>
> # preference for default route
>
> ip route add default via 202.51.76.122
>
> # routing rules
>
> ip rule add from ppp0 table T1
> ip rule add from 203.78.165.154 table T2
>
> # entries for local network
>
> ip route add 172.16.100.0/24 dev eth0 table T1
> ip route add 203.78.165.0/24 dev eth2 table T1
> ip route add 127.0.0.0/8 dev lo table T1
> ip route add 172.16.100.0/24 dev eth0 table T2
> ip route add 202.51.78.0/24 dev eth1 table T2
> ip route add 127.0.0.0/8 dev lo table T2
>
> #load balancing
> ip route add default scope global nexthop via ppp0 dev eth1 weight 1
> nexthop via 203.78.165.153 dev eth2 weight 1
>
> this above one is the full and exact copy of my working....*
>
> *
>
>
>
>
> Indunil Jayasooriya < indunil75@gmail.com>*
>
> wrote:
>
>
>
> On 8/21/07, *mangal regmi* <mangalregmi@yahoo.com> wrote:
>
> Hi to all
> i think this is not a new problem for this forum....but its newest for me
> as i m a new linux lerner. Even if it is new plzz....reply me ur answer..n
> if its already asked n have solution..plzz forward the solution. My problem
> is here mentioned:
> I have fedora core 4 as a linux server. there r two external links
> connected to this.
>
>
> I there are 2 external links, What is the file */etc/sysconfig/network*like?
>
> Can you witre down the file?
>
>
>
> the settings are as: eth0 ->for internal (that is for LAN)
> eth2 ->dsl connection
> eth1 ->cable line connection( this connection
> has no gateway and netmask address provided so this is connected via ppp0.
> this is provided from ISP via DHCP but have the fixed ipaddress) Hey, What
> is this FIXED ip address? Is it a perment address?
>
>
>
> YOUR eth0 of Fedora Server is for internal (that is for LAN)
> YOUR eth2 of Fedora Server is connected to the dsl connection.
> YOUR eth1 of Fedora Server is connected to the cable line connection. It
> has a ip.
>
> i want to use these two link to provide the internet in my LAN where
> there are about 8 to 10 computers. i want that if any of the link goes down
> ...the other should continue the internet ...n also while both the links r
> up..the load should be shared between these two links....so that the net
> conection and downloads be faster....
>
> i have heard about the scripts....that can do this....but i have no idea
> how to write these...scripts. i need these to be on after reboot also...
>
>
> To come up the script after the reboot, There are two ways. Either you
> have to write everytning IN /etc/rc.d/rc.local or write the script as a
> seperate file and and make it executable by using chmod.
>
> Pls see bellow.
>
> first create the file as follows.
>
> *touch /etc/rc.d/loadbalancing*
>
> then , By using vi editor write the script and save it as usual. Then ,
> Make it executable as follows.
> *
> chmod 755 /etc/rc.d/loadbalancing
>
> *and finally add PATH OF THE SCRIPT to /etc/rc.d/rc.local file as follows.
> *
>
> etc/rc.d/loadbalancing*
> *
> *That's it. Now, whenever you reboot the system, the scripts also comes up
> with the system.
>
>
>
> i tried my best and i also refered the lartc.org ..but i could do a little
> only.
>
> WHAT I DID: it works very well if i connect both of the links and the
> default path is via ppp0. but suppose if that is(ppp0) disconnected then
> the dsl connection can handle only upto 15/16 seconds. after that it
> disconnects . whats the solution ...plzz...as..soon
> as..possible...help..me...i m in big trouble....
> UR SMALL HELP WILL BE A BIG BOON FOR ME
>
>
>
> COULD YOU PLS write down your RULES . then, I will be able to help you.
>
>
>
> Remember that i don't have gateway and netmask of eth1 connection. it has
> ip address only.it is NATed via ppp0. and also my all working are based on
> lartc.org only...in case of dsl connection i have just replaced the ip and
> gateways with my ip and gateways....n in case of ppp0 conection i have put
> ppp0 in the place of gateway n netmask and in place of ip i have given the
> ip of that link.
>
>
> The above paragraph is not so clear.
>
>
>
> THANKS IN ADVANCE
> ------------------------------
>
> Luggage? GPS? Comic books?
> Check out fitting gifts for grads
> <http://us.rd.yahoo.com/evt=48249/*http:/search.yahoo.com/search?fr=oni_on_mail&p=graduation+gifts&cs=bz>at
> Yahoo! Search.
>
>
> _______________________________________________
> LARTC mailing list
> LARTC@mailman.ds9a.nl
> http://mailman.ds9a.nl/cgi-bin/mailman/listinfo/lartc
>
>
>
>
> --
> Thank you
> Indunil Jayasooriya
>
>
>
> ------------------------------
>
> Choose the right car based on your needs. Check out Yahoo! Autos new Car
> Finder tool.<http://us.rd.yahoo.com/evt=48518/*http:/autos.yahoo.com/carfinder/;_ylc=X3oDMTE3NWsyMDd2BF9TAzk3MTA3MDc2BHNlYwNtYWlsdGFncwRzbGsDY2FyLWZpbmRlcg--+>
>
>
>
>
> --
> Thank you
> Indunil Jayasooriya
>
--
Thank you
Indunil Jayasooriya
[-- Attachment #1.2: Type: text/html, Size: 22850 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
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2007-08-22 4:16 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16 11:48 [LARTC] two providers Виталий Цховребов
2007-08-16 15:25 ` goblin
2007-08-17 4:57 ` Indunil Jayasooriya
2007-08-18 4:50 ` Mikhail
2007-08-18 6:23 ` Виталий Цховребов
-- strict thread matches above, loose matches on Subject: below --
2007-08-21 8:07 mangal regmi
2007-08-21 8:54 ` Indunil Jayasooriya
2007-08-21 10:43 ` mangal regmi
2007-08-21 11:23 ` Indunil Jayasooriya
2007-08-21 11:31 ` Salim S I
2007-08-22 4:16 ` Indunil Jayasooriya
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.