Re: multiple ppp links and routing ..
- From: ibuprofin@xxxxxxxxxxxxxxxxxxxxxx (Moe Trin)
- Date: Wed, 28 Jun 2006 15:00:01 -0500
On 28 Jun 2006, in the Usenet newsgroup comp.os.linux.networking, in article
<1151499148.342132.43630@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>, Lawrence wrote:
I'm using debian stable on a machine with multiple serial modems that
would eventually simultaneously connect the machine to the Internet.
Is this a continuation of the stuff you posted about back in January in
the uk.comp.os.linux newsgroup?
The file /etc/ppp/peers/ppp_provider1 :
OK
The file /etc/chatscripts/chat_script1 :
ABORT BUSY ABORT 'NO CARRIER' ABORT VOICE ABORT 'NO DIALTONE' ABORT
'NO DIAL TONE' ABORT 'NO ANSWER' ABORT DELAYED
Does your modem(s) really know how to say all of those words?
'' ATZ
Do you know specifically that this is the correct init-string for your
modem? "ATZ" sets what has been saved to NVRAM setting 0, and unless you
know positively that what is set in NVRAM, you are better off using the
factory default setting - almost always AT&Fn where 'n' is 0, 1, or maybe
2.
OK-AT-OK "ATDT0331051010"
OK ATDT0331051010
Because I need to apply the routing, and because pon returns
immediately I have to write some scripts to execute after ppp goes
online, ppp ip-up is the solution but this would execute every time a
ppp connection is established and I have to create a different routing
table for each ppp connection :
Use a 'case' statement based on the IP address of the peer (variable $5
in /etc/ppp/ip-up)
man bash
man ppp
man route
case "$5" in
12.34.56.78)
/sbin/route add -net 12.34.56.0 broadcast 12.34.56.255 netmask
255.255.255.0 gw $5 $1
;;
23.45.67.89)
/sbin/route add -net 23.45.67.0 broadcast 23.45.67.255 netmask
255.255.255.0 gw $5 $1
;;
esac
Then create a similar /etc/ppp/ip-down script that removes the route, again
using a case statement based on the peer's IP address.
I allow some users of the LAN (eth0) to use ppp1, and some other users
to use ppp2 and I know at the time i lunch pon which users should use
one or the other Internet access, my problem is that the connection
could be even 10 and I should be able to create a table with iproute2
on the fly for each connection and if already exist simply delete and
flush .. I'm a bit confused!
You'll also need to add some firewall rules to restrict use of each
connection. When you '/sbin/route add -net' that route is available
to _all_ users, not just the one who brought up the connection.
I don't know how to write this script, I know I have $1 to $6 as
parameters of the connection and that I could use a couple of if
condition to check whatever is the first , second, third ppp connection
being bought up and then, dunno how, create/delete/update the tables ..
A case statement is probably easier. See the Bash-Prog-Intro-HOWTO and
the "Advanced Bash Scripting Guide" from http://tldp.org/guides.html.
Old guy
.
- Follow-Ups:
- Re: multiple ppp links and routing ..
- From: Lawrence
- Re: multiple ppp links and routing ..
- References:
- multiple ppp links and routing ..
- From: Lawrence
- multiple ppp links and routing ..
- Prev by Date: Re: Newbie Questions
- Next by Date: Disable send ICMP redirect?
- Previous by thread: multiple ppp links and routing ..
- Next by thread: Re: multiple ppp links and routing ..
- Index(es):
Relevant Pages
|