mv /etc/localtime /etc/localtime_org && ln -s /usr/share/zoneinfo/"Europe/Moscow" /etc/localtime && date
echo net.ipv6.conf.all.disable_ipv6=1 > /etc/sysctl.d/disableipv6.conf
deb http://http.debian.net/debian wheezy-backports main contrib non-free deb http://mirror.yandex.ru/debian/ wheezy-backports main contrib non-free
apt-get update apt-get install cmake make libssl-dev libpcre3-dev libnet-snmp-perl libtritonus-bin bzip2 checkinstall ntpdate
ntpdate DC.DOMAIN.COM
http://downloads.sourceforge.net/project/accel-ppp/accel-ppp-1.9.0.tar.bz2
tar -xjf accel-ppp-1.9.0.tar.bz2 mkdir accel-ppp-build cd accel-ppp-build
cmake -DBUILD_PPTP_DRIVER=FALSE -DLOG_PGSQL=FALSE -DNETSNMP=FALSE -DRADIUS=TRUE -DSHAPER=TRUE /root/accel-ppp-1.9.0/ make checkinstall -D
cd ../accel-ppp-1.9.0/contrib/debian cp accel-ppp-init /etc/init.d/accel-ppp
which accel-pppd
nano /etc/init.d/accel-ppp
insserv -v accel-ppp
mkdir /var/log/accel-ppp/
touch /etc/ppp/chap-secrets
[modules] path=/usr/local/lib64/accel-ppp # . log_file # syslog. #log_syslog # pptp l2tp # auth_mschap_v2 auth_mschap_v1 auth_chap auth_pap # CHAP-secrets radius #chap-secrets # RADIUS chap-secrets radius # IPv4 . ippool sigchld # ip-up/ip-down RADIUS CoA . #pppd_compat # . shaper # . #connlimit [core] log-error=/var/log/accel-ppp/core.log thread-count=4 [ppp] verbose=0 min-mtu=1280 mtu=1480 mru=1480 #ccp=1 check-ip=1 # . # replace - accel- , . # deny accel- #single-session=replace # MPPE (Microsoft Point-to-Point Encryption) # prefer – mppe=prefer ipv4=prefer # , 0, PPP LCP - n . lcp-echo-interval=300 # - , n . lcp-echo-failure=6 [dns] dns1=8.8.8.8 dns2=8.8.4.4 [auth] #any-login=0 #noauth=0 [pptp] bind=..1.99 echo-interval=300 echo-failure=6 verbose=0 [l2tp] bind=..1.99 #ppp-max-mtu=1300 dictionary=/usr/local/share/accel-ppp/l2tp/dictionary hello-interval=300 #timeout=60 #rtimeout=5 retransmit=3 host-name=vpn.mydomain.ru #dir300_quirk=1 #secret= verbose=0 [radius] dictionary=/usr/local/share/accel-ppp/radius/dictionary nas-identifier=cisco nas-ip-address=127.0.0.1 gw-ip-address=..1.99 auth-server=127.0.0.1:1812,Radius-Sicret acct-server=127.0.0.1:1813,Radius-Sicret server=127.0.0.1,Radius-Sicret,auth-port=1812,acct-port=1813,req-limit=0,fail-time=0 dae-server=127.0.0.1:3799,Radius-Sicret timeout=5 max-try=3 acct-timeout=600 acct-delay-time=1 verbose=0 [shaper] attr=Filter-Id #down-burst-factor=1.0 #up-burst-factor=1.0 #latency=50 #mpu=0 #time-range=1,7:00-00:59 #time-range=2,1:00-3:59 #time-range=3,4:00-6:59 #leaf-qdisc=sfq perturb 10 up-limiter=htb down-limiter=htb cburst=1375000 ifb=ifb0 r2q=10 quantum=1500 verbose=0 # IP-, : xxxx/mask (for example 10.0.0.0/8) [client-ip-range] #192.168.0.0/18 disable [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=/var/log/accel-ppp/debug.log #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=0 # , #[chap-secrets] #gw-ip-address=..1.99 #chap-secrets=/etc/ppp/chap-secrets [ip-pool] attr=Framed-Pool gw-ip-address=..1.99 10.65.16.129-254,fullaccess 10.65.17.129-254,mobila 10.65.18.129-254,office [cli] telnet=127.0.0.1:2000 tcp=127.0.0.1:2001 #password=123 #[connlimit] #limit=10/min #burst=3 #timeout=60
service accel-ppp start
sysctl -p
accel-cmd show session
apt-get -t wheezy-backports install strongswan libcharon-extra-plugins
# ipsec.conf - strongSwan IPsec configuration file config setup # strictcrlpolicy=no include /var/lib/strongswan/ipsec.conf.inc conn %default ikelifetime=1440m keylife=60m rekeymargin=3m keyingtries=1 keyexchange=ikev1 authby=xauthpsk # Dead Peer Detection (DPD) , , dpdaction=clear # DPD # dpddelay=35s # DPD # dpdtimeout=300s # . IPsec , IP- fragmentation=yes # . Windows . rekey=no # ciphersuites IKE ike=aes256gcm16-aes256gcm12-aes128gcm16-aes128gcm12-aesxcbc-sha256-sha1-modp4096-modp2048-modp1024,aes256-aes128-sha256-sha1-modp4096-modp2048-modp1024! # ciphersuites esp=aes128gcm12-aes128gcm16-aes256gcm12-aes256gcm16-modp4096-modp2048-modp1024,aes128-aes256-sha1-sha256-modp4096-modp2048-modp1024,aes128-sha1-modp1024,aes128-sha1! conn L2TP_Accel-PPP authby=psk rekey=no type=transport esp=aes128-sha1,null-sha1,md5 ike=aes128-sha-modp1024,null-sha1,md5 left=194.135.1.99 leftprotoport=17/%any # 1701 iOS right=%any rightprotoport=17/%any rightsubnetwithin=0.0.0.0/0 auto=add compress=no dpddelay=30 dpdtimeout=120 dpdaction=clear forceencaps=yes conn IPsec authby=secret rekeymargin=3m keyingtries=1 keyexchange=ikev1 leftfirewall=yes rekey=no left=XX.YY.1.99 leftsubnet=0.0.0.0/0 leftauth=psk rightsourceip=%radius rightdns=8.8.8.8 right=%any rightauth=psk rightauth2=xauth-radius dpdaction=clear dpdtimeout = 5s auto=add
: PSK "Sicret-Test-Key"
eap-radius { accounting = yes load = yes nas_identifier = StrongSwan # Radius secret = Radius-Sicret server = 127.0.0.1 dae { enable = yes listen = 127.0.0.1 port = 3799 secret = Radius-Sicret } forward { } servers { } xauth { } }
service ipsec start
ipsec statusall
apt-get install freeradius freeradius-ldap
client localhost { ipaddr = 127.0.0.1 secret = Radius-Sicret nastype = cisco shortname = MY_TEST_VPN }
authorize { preprocess chap mschap ldap # ntlm_auth digest suffix eap { ok = return } files expiration logintime pap } authenticate { Auth-Type PAP { pap } Auth-Type CHAP { chap } Auth-Type MS-CHAP { mschap } Auth-Type LDAP { ldap } # Auth-Type ntlm_auth { # ntlm_auth # } digest unix eap } preacct { preprocess acct_unique suffix files } accounting { detail unix radutmp exec attr_filter.accounting_response } session { radutmp } post-auth { exec Post-Auth-Type REJECT { attr_filter.access_reject } } pre-proxy { } post-proxy { eap }
# , , # #perl -e 'print(crypt("testpassword","abrakadabra")."\n");' # #testuser Crypt-Password := "abA5hjwYqm1.I" testuser Cleartext-Password := "testpassword" , MS-CHAP-Use-NTLM-Auth := 0 Service-Type = Framed-User, Framed-Protocol = PPP, # IP, , Framed-Pool Framed-IP-Address = 10.65.18.12, Framed-IP-Netmask = 255.255.255.255, # , ip-pool accel-ppp Framed-Pool = "office", # . Filter-Id = "100000/100000", # , Reply-Message = "Accepted from local file" # # Idle-Timeout, Acct-Interim-Interval .. # LDAP, # remote-connection office, ip-pool accel-ppp DEFAULT Ldap-Group == "remote-connection" Service-Type = Framed-User, Framed-Protocol = PPP, Framed-Pool = "office", Filter-Id = "100000/100000" # DEFAULT Ldap-Group == "full-access" Service-Type = Framed-User, Framed-Protocol = PPP, Framed-Pool = "fullaccess" # # Filter-Id = "100000/100000" DEFAULT Ldap-Group == "mobile-access" Service-Type = Framed-User, Framed-Protocol = PPP, Framed-Pool = "mobila", Filter-Id = "100000/100000"
service freeradius restart
radtest testuser testpassword 127.0.0.1 0 Radius-Sicret
Sending Access-Request of id 238 to 127.0.0.1 port 1812 User-Name = "testuser" User-Password = "testpassword" NAS-IP-Address = XX.YY.1.99 NAS-Port = 0 Message-Authenticator = 0x00000000000000000000000000000000 rad_recv: Access-Accept packet from host 127.0.0.1 port 1812, id=238, length=105 Service-Type = Framed-User Framed-Protocol = PPP Framed-IP-Address = 10.65.18.12 Framed-IP-Netmask = 255.255.255.255 Framed-Pool = "office" Filter-Id = "100000/100000" Reply-Message = "Accepted from local file"
exec ntlm_auth { wait = yes program = "/usr/bin/ntlm_auth --request-nt-key --domain=KR.LOC --username=%{mschap:User-Name} --password=%{User-Password}" }
mschap { # use_mppe = yes # , , - yes require_encryption = no require_strong = yes with_ntdomain_hack = no ntlm_auth = "/usr/bin/ntlm_auth --request-nt-key --username=%{%{Stripped-User-Name}:-%{%{User-Name}:-None}} --challenge=%{%{mschap:Challenge}:-00} --nt-response=%{%{mschap:NT-Response}:-00}" }
ldap { server = "10.13.205.7" # identity = "sf-test@KR.LOC" # password = "987654321" # basedn = "dc=KR,dc=LOC" # filter = "(sAMAccountName=%{%{Stripped-User-Name}:-%{User-Name}})" ldap_connections_number = 5 max_uses = 0 #port = 389 timeout = 4 timelimit = 3 net_timeout = 1 tls { start_tls = no } dictionary_mapping = ${confdir}/ldap.attrmap password_attribute = userPassword edir_account_policy_check = no groupname_attribute = cn groupmembership_filter = "(|(&(objectClass=GroupOfNames)(member=%{control:Ldap-UserDn}))(&(objectClass=GroupOfUniqueNames)(uniquemember=%{control:Ldap-UserDn})))" groupmembership_attribute = memberOf access_attr_used_for_allow = yes chase_referrals = yes rebind = yes # set_auth_type = yes keepalive { idle = 60 probes = 3 interval = 3 } }
replyItem Framed-IP-Address msRADIUSFramedIPAddress replyItem Framed-Pool msRADIUSFramedRoute
apt-get install krb5-user libpam-krb5 samba winbind libnss-winbind libpam-winbind -t wheezy-backports
[global] obey pam restrictions = Yes log file = /var/log/samba/log.%m log level = 1 socket options = TCP_NODELAY SO_SNDBUF=8192 SO_RCVBUF=8192 encrypt passwords = yes idmap config * : range = 10000-20000 idmap config * : backend = tdb auth methods = winbind name resolve order = hosts bcast lmhosts case sensitive = no dns proxy = no netbios name = SAMBA server string = %v samba password server = DC02.KR.LOC # realm = KR.LOC client use spnego = yes client signing = yes local master = no domain master = no preferred master = no workgroup = KR debug level = 2 # ads security = ads unix charset = UTF-8 dos charset = 866 max log size = 50 os level = 0 follow symlinks = yes winbind uid = 10000-20000 winbind gid = 10000-20000 winbind enum groups = yes winbind enum users = yes
passwd: compat winbind group: compat winbind shadow: compat winbind
[logging] default = FILE:/var/log/krb5.log kdc = FILE:/var/log/krb5kdc.log [libdefaults] default_realm = KR.LOC clockskew = 500 dns_lookup_realm = false dns_lookup_kdc = true ticket_lifetime = 324000 [realms] KR.LOC = { kdc = DC02.KR.LOC admin_server = DC02.KR.LOC default_domain = KR.LOC } [domain_realm] .kr.loc = KR.LOC [login] krb4_convert = true krb4_get_tickets = false
service samba restart service winbind restart
kinit sf-test@KR.LOC
Password for sf-test@KR.LOC:
net join –U sf-test@KR.LOC
wbinfo -u wbinfo -g
id domain_user
ntlm_auth --request-nt-key --domain=KR.LOC --username=sf-test --password=123456789
radtest -t mschap sf-test 123456789 127.0.0.1 0 Radius-Sicret
conn juniper forceencaps=yes dpddelay=30 # Dead peer detection - 30 - keep-alive dpdtimeout=120 # dpd 120 , # IKE alg 3DES - HASH sha1 - DH group 2 (1024) ike=3des-sha1-modp1024 # IKE lifetime 86400 seconds (24 hours) ikelifetime=86400s # IKE auth method Pre-Shared Key (PSK secret) authby=secret # IPSec type tunnel type=tunnel # - #left side (myside) left=..1.99 # OpenSWAN side leftsubnet=10.65.0.0/16 # , right=..116.5 # rightsubnet=192.168.105.0/24 # , VPN auto=start esp=3des-sha1,3des-md5 keyexchange=ikev1
Source: https://habr.com/ru/post/267103/
All Articles