How to disconnect pptp client connected to Cent OS 6.2 server from the server side ? ifdown ppp0 doesn't work.
Asked
Active
Viewed 1.0k times
0
-
This appears to be a duplicate question [http://serverfault.com/questions/195409/pptp-vpn-kill-user-connection](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 '16 at 04:44
2 Answers
0
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}

Chandan Gupta
- 101
- 2
-
-
2I want to disconnect particular client. but killing process will disconnect all the client. – anupsth Mar 22 '13 at 01:05
-
1try 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 04:58
-
-
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
-
I am afraid if I can tell you something like that. Wait for somebody else here :) Sorry mate! – Chandan Gupta Mar 29 '13 at 10:10
0
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

ALex_hha
- 7,193
- 1
- 25
- 40