xebd / accel-ppp

High performance PPTP/L2TP/PPPoE/IPoE server for Linux
GNU General Public License v2.0
296 stars 109 forks source link

[ipoe] specified local ip-pool is used only by 50%, then i've got an error: no free IPv4 address #15

Closed strobil closed 6 years ago

strobil commented 6 years ago

System: 4.4.39-gentoo Accel-PPP version: 1.11.1_p20170508 Problem description: Accel-ppp is using only half (~256 in my case) of specified local ippool, and when it reach 253 active sessions an error "error: ipoe253: no free IPv4 address" appears in my accel-ppp log file.

If i change range mask from /23 to /24 - this error will appear at ~130 active sessions. Looks like it does no matter the size of pool. Accel-PPP will always use a half.

Config file is below:

[modules]
log_file
#log_syslog
#log_tcp
#log_pgsql

#pptp
#l2tp
#pppoe
ipoe

auth_mschap_v2
auth_mschap_v1
auth_chap_md5
auth_pap

radius
#chap-secrets

ippool

pppd_compat

shaper
#net-snmp
#logwtmp
#connlimit

#ipv6_nd
#ipv6_dhcp
#ipv6pool

#net-accel-dp

[core]
log-error=/var/log/accel-ppp/core.log
thread-count=4

[common]
single-session=replace
#sid-case=upper
#sid-source=seq

[ppp]
verbose=1
min-mtu=1280
mtu=1400
mru=1400
#accomp=deny
#pcomp=deny
#ccp=0
#check-ip=0
#mppe=require
ipv4=require
ipv6=deny
ipv6-intf-id=0:0:0:1
ipv6-peer-intf-id=0:0:0:2
ipv6-accept-peer-intf-id=1
lcp-echo-interval=20
#lcp-echo-failure=3
lcp-echo-timeout=120
unit-cache=1
#unit-preallocate=1

[auth]
#any-login=0
#noauth=0

[pptp]
verbose=1
#echo-interval=30

[pppoe]
verbose=1
#ac-name=xxx
#service-name=yyy
#pado-delay=0
#pado-delay=0,100:100,200:200,-1:500
called-sid=mac
#tr101=1
#padi-limit=0
#ip-pool=pppoe
#sid-uppercase=0
#vlan-mon=eth0,10-200
#vlan-timeout=60
#vlan-name=%I.%N
#interface=eth1,padi-limit=1000,net=accel-dp
interface=eth0

[l2tp]
verbose=1
#dictionary=/usr/local/share/accel-ppp/l2tp/dictionary
#hello-interval=60
#timeout=60
#rtimeout=1
#rtimeout-cap=16
#retransmit=5
#recv-window=16
#host-name=accel-ppp
#dir300_quirk=0
#secret=
#dataseq=allow
#reorder-timeout=0
#ip-pool=l2tp

[ipoe]
verbose=1
mode=L2
shared=1
start=dhcpv4
ifcfg=1
lua-file=/etc/accel-ppp.lua
username=lua:username
password=empty
lease-time=300
max-lease-time=600
interface=enp77s0f1.3000,range=178.209.68.0/23

[dns]
dns1=8.8.8.8
dns2=8.8.4.4

[wins]
#wins1=172.16.0.1
#wins2=172.16.1.1

[radius]
#dictionary=/usr/local/share/accel-ppp/radius/dictionary
nas-identifier=accel-ppp
nas-ip-address=127.0.0.1
gw-ip-address=192.168.100.1
server=127.0.0.1,testing123,auth-port=1812,acct-port=1813,req-limit=50,fail-timeout=0,max-fail=10,weight=1
dae-server=127.0.0.1:3799,testing123
verbose=1
#timeout=3
#max-try=3
acct-interim-interval=3600
#acct-timeout=120
#acct-delay-time=0
#acct-on=0
#attr-tunnel-type=My-Tunnel-Type

[client-ip-range]
10.0.0.0/8

[ip-pool]
gw-ip-address=178.209.68.1
#vendor=Cisco
#attr=Cisco-AVPair
attr=Framed-Pool
178.209.68.0/23,name=trinity1
#5.105.184.0/24,name=trinity2

[log]
log-file=/var/log/accel-ppp/accel-ppp.log
log-emerg=/var/log/accel-ppp/emerg.log
log-fail-file=/var/log/accel-ppp/auth-fail.log
#log-debug=/dev/stdout
#syslog=accel-pppd,daemon
#log-tcp=127.0.0.1:3000
copy=1
#color=1
#per-user-dir=per_user
#per-session-dir=per_session
#per-session=1
level=3

[log-pgsql]
conninfo=user=log
log-table=log

[pppd-compat]
#ip-pre-up=/etc/ppp/ip-pre-up
ip-up=/etc/ppp/ip-up
ip-down=/etc/ppp/ip-down
ip-change=/etc/ppp/ip-change
radattr-prefix=/var/run/radattr
verbose=1

[chap-secrets]
gw-ip-address=192.168.100.1
#chap-secrets=/etc/ppp/chap-secrets
#encrypted=0
#username-hash=md5

[shaper]
#attr=Filter-Id
#down-burst-factor=0.1
#up-burst-factor=1.0
#latency=50
#mpu=0
#mtu=0
#r2q=10
#quantum=1500
#moderate-quantum=1
#cburst=1534
#ifb=ifb0
up-limiter=police
down-limiter=tbf
#leaf-qdisc=sfq perturb 10
#leaf-qdisc=fq_codel [limit PACKETS] [flows NUMBER] [target TIME] [interval TIME] [quantum BYTES] [[no]ecn]
#rate-multiplier=1
#fwmark=1
verbose=1

[cli]
verbose=1
telnet=127.0.0.1:2000
tcp=127.0.0.1:2001
#password=123

[snmp]
master=0
agent-name=accel-ppp

[connlimit]
limit=10/min
burst=3
timeout=60

[ipv6-pool]
fc00:0:1::/48,64
delegate=fc00:1::/36,48

[ipv6-dns]
#fc00:1::1
#fc00:1::2
#fc00:1::3
#dnssl=suffix1.local.net
#dnssl=suffix2.local.net.

[ipv6-dhcp]
verbose=1
pref-lifetime=604800
valid-lifetime=2592000
route-via-gw=1

[accel-dp]
socket=/var/run/accel-dp.sock
xebd commented 6 years ago

commit 43bd92e615d94342b689a20eff2df51b5b517c5f

strobil commented 6 years ago

@xebd , can't confirm :( With /23 pool i have only 252 active sessions, and a lot of log message like this:

[2017-12-15 11:57:01]: warn: ipoe248: authentication failed [2017-12-15 11:57:01]: info: ipoe248: ipoe: session finished [2017-12-15 11:57:01]: error: ipoe193: ipoe: nl_modify: File exists [2017-12-15 11:57:01]: info: ipoe193: ipoe: session finished [2017-12-15 11:57:01]: error: ipoe252: ipoe: nl_modify: File exists [2017-12-15 11:57:01]: info: ipoe252: ipoe: session finished [2017-12-15 11:57:01]: error: ipoe249: ipoe: nl_modify: File exists [2017-12-15 11:57:01]: info: ipoe249: ipoe: session finished

Is it possible to have one ip range for several interfaces, like below?

interface=enp77s0f1.3000,range=178.209.68.0/23 interface=enp77s0f1.3001,range=178.209.68.0/23

xebd commented 6 years ago

these messages are not related to ip-pool please set log level=5

strobil commented 6 years ago

@xebd, last 2k lines of log file with level=5 accel-ppp.log

with config below i have 343 actives sessions

interface=enp77s0f1.3000,range=178.209.68.0/23 interface=enp77s0f1.3001,range=5.105.184.0/22

but with this config i have only 252

interface=enp77s0f1.3000,range=178.209.68.0/23 interface=enp77s0f1.3001,range=178.209.68.0/23

https://accel-ppp.org/forum/viewtopic.php?t=58#p372 This is actual info? Maybe i should use ip-pool instead of range on several ifaces? But this feature not documented in manpage for accel-ppp.conf :(

к сожалению общий range на несколько интерфейсов не реализован предлагаю использовать ip-pool вместо range

strobil commented 6 years ago

With those config all works fine, i have 351 active session. But the next question, does ip-pool variable supports several ip-pool names? Like ip-pool=pool1,pool2,pool3?

[ipoe] verbose=1 mode=L2 shared=1 start=dhcpv4 ifcfg=1 lua-file=/etc/accel-ppp.lua username=lua:username password=empty lease-time=300 max-lease-time=600 interface=re:^enp77s0f1.*$ ip-pool=trinity gw-ip-address=178.209.68.1/23 unit-cache=300 [ip-pool] gw-ip-address=178.209.68.1

vendor=Cisco

attr=Cisco-AVPair

attr=Framed-Pool 178.209.68.0/23,name=trinity