Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to make ppp0 default gateway automaticly?

1,537 views
Skip to first unread message

Robert Waldner

unread,
Aug 16, 2001, 2:10:07 AM8/16/01
to

On Thu, 16 Aug 2001 14:05:07 +0800, Tao Liu writes:
<snip>
>but how can I make ppp0 the default gateway automaticly when ppp0 is up?
<snip>

waldner@wz:~$ grep def /etc/ppp/options
defaultroute

hth+cheers,
&rw
--
-- "Women novelists are a bit like a dog walking
-- upon his hind legs; he does not do it well but
-- one is surprised to see that he does it at all"
----


Tao Liu

unread,
Aug 16, 2001, 2:10:06 AM8/16/01
to
I installed ppp2.4.1 with the pppoe plugin patch.
And it does not have a script like /etc/init.d/pppd

I always type
pppd eth0
(wait a while and make sure ppp0 is up)
route add default gw x.x.x.x (isp's ip)
to make it work.

but how can I make ppp0 the default gateway automaticly when ppp0 is up?

Can I add some option to ppp, so ppp will do the right thing?
Or must I need a script like the original /etc/init.d/pppd comes with
debian's package?

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


--
To UNSUBSCRIBE, email to debian-us...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listm...@lists.debian.org

Ian Perry

unread,
Aug 16, 2001, 2:30:09 AM8/16/01
to
> From: wal...@waldner.priv.at [mailto:wal...@waldner.priv.at]
> Sent: Thursday, August 16, 2001 4:07 PM

> On Thu, 16 Aug 2001 14:05:07 +0800, Tao Liu writes:
> <snip>
> >but how can I make ppp0 the default gateway automaticly when
> ppp0 is up?
> <snip>
>
> waldner@wz:~$ grep def /etc/ppp/options
> defaultroute
>

I also believe that
route add default ppp0
also works (although it is a while since I have done tis.

Ian

Robert Waldner

unread,
Aug 16, 2001, 2:40:04 AM8/16/01
to

>> <snip>
>> >but how can I make ppp0 the default gateway automaticly when
>> ppp0 is up?
>> <snip>
>>
>> waldner@wz:~$ grep def /etc/ppp/options
>> defaultroute
>>
>
>I also believe that
>route add default ppp0
>also works (although it is a while since I have done tis.

dunno, but if you have to set the route manually
route add -net 0/0 ppp0
will certainly work.

It愀 just that Tao asked for auto/magic, and that lies in the
options-file resp. in invoking pppd like
pppd eth0 defaultroute
(maybe the options must be reserved, I don愒 have PPPoE-hacks in my
pppd, only PPTP- ones).

cheers,
&rw

--
-- Windows, another fine product from the folks who gave us edlin.
----


Ian Perry

unread,
Aug 16, 2001, 2:50:05 AM8/16/01
to
> From: wal...@waldner.priv.at [mailto:wal...@waldner.priv.at]
> Sent: Thursday, August 16, 2001 4:31 PM

>
> >> <snip>
> >> >but how can I make ppp0 the default gateway automaticly when
> >> ppp0 is up?
> >> <snip>
> >>
> >> waldner@wz:~$ grep def /etc/ppp/options
> >> defaultroute
> >>
> >
> >I also believe that
> >route add default ppp0
> >also works (although it is a while since I have done tis.

Just looked at the ISDN scripts here at work...
route add default ippp0
should be the same for ppp0 tho

>
> dunno, but if you have to set the route manually
> route add -net 0/0 ppp0
> will certainly work.
>
> It愀 just that Tao asked for auto/magic, and that lies in the
> options-file resp. in invoking pppd like
> pppd eth0 defaultroute
> (maybe the options must be reserved, I don愒 have PPPoE-hacks in my
> pppd, only PPTP- ones).
>

defaultroute in options is definately the right way to go.
I had one machine here a while ago where we put the route sdd default.... in
the ip-up script

Nik Butler

unread,
Aug 16, 2001, 3:00:09 AM8/16/01
to
Five steps.

1. Ensure that no other default route is defined prior to enabling ppp.

2. add the keyword
defaultroute
to your ppp options file.

3. ensure that your resolv.conf points to a good Domain Name server

4. ensure that ip_forward under /proc/sys/net/ipv4/ is set at value 1.

5. Run a good firewall script on ipchains/iptables to ensure port forwarding
and security.


Regards

Nik Butler
Director Wired4Life Limited
n...@wired4life.org
07713 241 956
www.wired4life.org

Tao Liu

unread,
Aug 16, 2001, 3:40:06 AM8/16/01
to
On Thursday 16 August 2001 14:54, Nik Butler wrote:
> Five steps.
>
> 1. Ensure that no other default route is defined prior to enabling ppp.
>
> 2. add the keyword
> defaultroute
> to your ppp options file.
>
> 3. ensure that your resolv.conf points to a good Domain Name server
>
> 4. ensure that ip_forward under /proc/sys/net/ipv4/ is set at value 1.
>
> 5. Run a good firewall script on ipchains/iptables to ensure port
> forwarding and security.

I have done the first 4 steps, and is going to step 5.
Which script shall I insert my firewall script to?
(In redhat, I insert it to /etc/rc.d/rc.local)

Regards
Tao Liu



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

Nik Butler

unread,
Aug 16, 2001, 3:50:04 AM8/16/01
to
> Which script shall I insert my firewall script to?
> (In redhat, I insert it to /etc/rc.d/rc.local)
>
> Regards
> Tao Liu

Well thats gonna depend on your kernel but lets assume your running 2.2 and
use ipchains for firewalling.

Goto freshmeat.net and search for "ipchains-firewall" which provides a perl
script that can be run as
firewall.sh ppp0 eth0

place a new script in your /etc/ppp/ip-up.d/ directory as
90firewall.sh make sure its executable and it should at least
contain
#/bin/sh
firewall.sh ppp0 eth0

If our using kernel 2.4.x then look for a similar script for "iptables" of
which a few exist and provide similar functionality to ipchains-firewall

Try to make use of the ip-up.d and ip-down.d local directories under
/etc/ppp as this will let you ensure that certain scripts can be
enabled/disabled when ppp goes up. Note also that these scripts export a n
umber of environment variables which allow you to more clearly specify
elements for your script.

Regards

Nik Butler
Director Wired4Life Limited
n...@wired4life.org
07713 241 956
www.wired4life.org

0 new messages