ppp server "ip-up" "ip-down" problem

ppp server "ip-up" "ip-down" problem

Post by Alfre » Sun, 01 Apr 2001 06:23:18



Dear sir

I got a problem about the ppp "ip-up"  "ip-down" , would you mind
give me some help !

here is the stiuation :
I have setup a ppp server, which is provide an internet service like a
ISP, so when someone login (we call it userA ) it will bring up the pppoe
connection (set in the ip-up) then when userA logout it will stop the
connection (set in the ip-down). it's working well and  i very love it cause
it can save my money.
but now i want to add more one line , and the problem is when userA login
and userB also login, after a little time userA want to logout, in this time
because of the ip-down seting, it will stop the pppoe connection, so that
userB will be stop the internet access.

How can i solve this problem, some thing like a shell or script or program

I'm using redhat 7.0
ppp-2.3.11.7
kernel 2.2.17-3.r
rp-pppoe-3.0-1

this is my "ip-up" file seting
#!/bin/bash
# This file should not be modified -- make local changes to
# /etc/ppp/ip-up.local instead
LOGDEVICE=$6
REALDEVICE=$1
export PATH=/sbin:/usr/sbin:/bin:/usr/bin
/etc/sysconfig/network-scripts/ifup-post ifcfg-${LOGDEVICE}

#start the pppoe connetcion
/etc/rc.d/init.d/adsl start
exit 0

this is my "ip-down" file seting
#!/bin/bash
# This file should not be modified -- make local changes to
# /etc/ppp/ip-down.local instead
LOGDEVICE=$6
REALDEVICE=$1

/etc/sysconfig/network-scripts/ifdown-post ifcfg-${LOGDEVICE}
#stop the pppoe connetcion
/etc/rc.d/init.d/adsl stop
exit 0

maybe it can add some command in "ip-down" if the pppX is runing then don't
kill it , but i don't know how.

Thank a lot !

 
 
 

ppp server "ip-up" "ip-down" problem

Post by Clifford Kit » Mon, 02 Apr 2001 05:31:38



> here is the stiuation :
> I have setup a ppp server, which is provide an internet service like a
> ISP, so when someone login (we call it userA ) it will bring up the pppoe
> connection (set in the ip-up) then when userA logout it will stop the
> connection (set in the ip-down). it's working well and  i very love
> it cause it can save my money.
> but now i want to add more one line , and the problem is when userA login
> and userB also login, after a little time userA want to logout, in this time
> because of the ip-down seting, it will stop the pppoe connection, so that
> userB will be stop the internet access.
> How can i solve this problem, some thing like a shell or script or program

[...]

> this is my "ip-down" file seting
> #!/bin/bash
> # This file should not be modified -- make local changes to
> # /etc/ppp/ip-down.local instead
> LOGDEVICE=$6
> REALDEVICE=$1

> /etc/sysconfig/network-scripts/ifdown-post ifcfg-${LOGDEVICE}
> #stop the pppoe connetcion
> /etc/rc.d/init.d/adsl stop
> exit 0
> maybe it can add some command in "ip-down" if the pppX is runing then don't
> kill it , but i don't know how.

Would putting the line

if /sbin/ifconfig|/bin/grep ppp; then exit; fi

just before the "/etc/rc.d/init.d/adsl stop" line do what you want?

(It's not clear to me exactly what you are doing, but for Internet
access with two connections you will need two routable IP addresses
or IP masquerading.  Internet access from behind IP masquerading won't
be as fully functional as that provided by routable IP addresses.)

--

/* Speak softly and carry a sucker rod (See man syslogd, footnote to
   recommendation 4 under SECURITY THREATS). */

 
 
 

ppp server "ip-up" "ip-down" problem

Post by Chris Friese » Mon, 02 Apr 2001 14:30:06



> Dear sir

> I got a problem about the ppp "ip-up"  "ip-down" , would you mind
> give me some help !

> here is the stiuation :
> I have setup a ppp server, which is provide an internet service like a
> ISP, so when someone login (we call it userA ) it will bring up the pppoe
> connection (set in the ip-up) then when userA logout it will stop the
> connection (set in the ip-down). it's working well and  i very love it cause
> it can save my money.
> but now i want to add more one line , and the problem is when userA login
> and userB also login, after a little time userA want to logout, in this time
> because of the ip-down seting, it will stop the pppoe connection, so that
> userB will be stop the internet access.

How about creating a lock file that gets created or incremented whenever someone
logs in, and decremented whenever they log out.  If the file reaches zero, then
it's the last person to log out, so you take down the connection.

Chris