Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to disconnect pptp client connected to Cent OS 6.2 server from the server side ? ifdown ppp0 doesn't work.

share|improve this question
    
This appears to be a duplicate question http://serverfault.com/questions/195409/pptp-vpn-kill-user-connection. The question has also already been answered so please refer to that. – user5870571 Feb 13 at 4:44

simply try any of following. That should work. here #pid is process id of pptp service.

`kill $pid` or `killall pppd`

or use

# kill {pppd-PID}
share|improve this answer
    
use 'sudo' if you have permission issues, needless to say :) – Chandan Gupta Mar 21 '13 at 13:15
2  
I want to disconnect particular client. but killing process will disconnect all the client. – anupsth Mar 22 '13 at 1:05
1  
try to find process id of the client you want to disconnect my be "ps aux" will give you in detail and you can see which one you want to disconnect. and then with kill #pid you can kill it. – Chandan Gupta Mar 22 '13 at 4:58
    
correction: "# kill {pppd-PID}" – Chandan Gupta Mar 22 '13 at 6:55
    
one process handles all client connection. Can you suggest me solution without stopping service or without killing process? – anupsth Mar 25 '13 at 17:37

You can use accel-ppp, because it has a really powerful cli. And you can disconnect particular user without any problem.

# telnet 127.0.0.1 2000
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
accel-ppp version c0b2b260b2c9b8c3375d51e90cd1edf552d7655a
Password: ******

The ip address 127.0.0.1 and port 2000 has been configured through main config file accel-ppp.conf

[cli]
telnet=127.0.0.1:2000
tcp=127.0.0.1:2001
password=1234567

To get current sessions you can use 'show sessions' command

accel-ppp# show sessions
 ifname | username |  calling-sid  |       ip       | type | comp | state  |  uptime
--------+----------+---------------+----------------+------+------+--------+----------
 ppp0   | alex     | 192.168.1.7   | 192.168.216.10 | pptp | mppe | active | 00:32:50
 ppp1   | john     | 192.168.1.100 | 192.168.216.11 | l2tp | mppe | active | 00:00:49

To terminate specific one you can use 'terminate' command

accel-ppp# terminate username john soft

accel-ppp# show sessions
 ifname | username | calling-sid |       ip       | type | comp | state  |  uptime
--------+----------+-------------+----------------+------+------+--------+----------
 ppp0   | alex     | 192.168.1.7 | 192.168.216.10 | pptp | mppe | active | 00:34:57

Terminate command has a lot of options

terminate if <interface> [soft|hard]- terminate session by interface name
        [match] username <username> [soft|hard]- terminate session by username
        ip <addresss> [soft|hard]- terminate session by ip address
        csid <id> [soft|hard]- terminate session by calling station id
        sid <id> [soft|hard]- terminate session by session id
        all [soft|hard]- terminate all sessions

In a log file /var/log/messages you will see

Mar 19 13:10:00 vpn accel-pppd: l2tp: new tunnel 59521-1 created following reception of SCCRQ from 192.168.1.100:1701
Mar 19 13:10:00 vpn accel-pppd: l2tp tunnel 59521-1 (192.168.1.100:1701): established at 192.168.1.6:1701
Mar 19 13:10:00 vpn accel-pppd: l2tp tunnel 59521-1 (192.168.1.100:1701): new session 898-1 created following reception of ICRQ
Mar 19 13:10:03 vpn accel-pppd: ppp1:john: connect: ppp1 <--> l2tp(192.168.1.100:1701 session 59521-1, 898-1)
Mar 19 13:10:03 vpn accel-pppd: ppp1:john: john: authentication succeeded
Mar 19 13:10:03 vpn accel-pppd: ppp1:john: IPV6CP: discarding packet
Mar 19 13:10:03 vpn accel-pppd: ppp1:john: session started over l2tp session 59521-1, 898-1
Mar 19 13:12:39 vpn accel-pppd: l2tp session 59521-1, 898-1: data channel closed, disconnecting session
Mar 19 13:12:39 vpn accel-pppd: l2tp tunnel 59521-1 (192.168.1.100:1701): no more session, disconnecting tunnel
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.