- 浏览: 1476288 次
- 性别:
- 来自: 北京
文章分类
- 全部博客 (691)
- linux (207)
- shell (33)
- java (42)
- 其他 (22)
- javascript (33)
- cloud (16)
- python (33)
- c (48)
- sql (12)
- 工具 (6)
- 缓存 (16)
- ubuntu (7)
- perl (3)
- lua (2)
- 超级有用 (2)
- 服务器 (2)
- mac (22)
- nginx (34)
- php (2)
- 内核 (2)
- gdb (13)
- ICTCLAS (2)
- mac android (0)
- unix (1)
- android (1)
- vim (1)
- epoll (1)
- ios (21)
- mysql (3)
- systemtap (1)
- 算法 (2)
- 汇编 (2)
- arm (3)
- 我的数据结构 (8)
- websocket (12)
- hadoop (5)
- thrift (2)
- hbase (1)
- graphviz (1)
- redis (1)
- raspberry (2)
- qemu (31)
- opencv (4)
- socket (1)
- opengl (1)
- ibeacons (1)
- emacs (6)
- openstack (24)
- docker (1)
- webrtc (11)
- angularjs (2)
- neutron (23)
- jslinux (18)
- 网络 (13)
- tap (9)
- tensorflow (8)
- nlu (4)
- asm.js (5)
- sip (3)
- xl2tp (5)
- conda (1)
- emscripten (6)
- ffmpeg (10)
- srt (1)
- wasm (5)
- bert (3)
- kaldi (4)
- 知识图谱 (1)
最新评论
-
wahahachuang8:
我喜欢代码简洁易读,服务稳定的推送服务,前段时间研究了一下go ...
websocket的helloworld -
q114687576:
http://www.blue-zero.com/WebSoc ...
websocket的helloworld -
zhaoyanzimm:
感谢您的分享,给我提供了很大的帮助,在使用过程中发现了一个问题 ...
nginx的helloworld模块的helloworld -
haoningabc:
leebyte 写道太NB了,期待早日用上Killinux!么 ...
qemu+emacs+gdb调试内核 -
leebyte:
太NB了,期待早日用上Killinux!
qemu+emacs+gdb调试内核
xl2tp客户端:https://blog.csdn.net/loomz/article/details/52955267
https://www.jianshu.com/p/e772ffc22e77
配置完客户端要加路由....???
最新的为https://www.iteye.com/blog/haoningabc-2480610
2018年2月14日更新:
aws的ip为172.31.26.41
iptables -t nat -A POSTROUTING -s 172.31.26.0/24 -o eth0 -j MASQUERADE
然后按照
http://blog.csdn.net/kitvv/article/details/50696585
操作
psk的那个secure文件改成
13.115.181.153 %any: PSK "haha"
################
在aws上建立rhel7.1的虚拟机
PermitRootLogin yes
PasswordAuthentication yes
参考
http://www.esojourn.org/blog/post/setup-l2tp-vpn-server-with-ipsec-in-centos6.php?page=2&part=1
使用xl2tp和ipsec,ppp让iphone和mac上网
注意的地方
1.尽量用新版本
2.配置的vpn用户名密码要是系统能登录的
3.http://pkgs.org/centos-7/nux-dextop-x86_64/xl2tpd-1.3.6-2.el7.nux.x86_64.rpm.html
下载对应的系统对应的rpm包 xl2tpd
rpm -ivh xl2tpd-1.3.6-8.el7.x86_64.rpm
4.yum install ppp openswan
openswan就是ipsec
5.我linode的ip是106.187.44.20,要替换下面的ip到你的ip
17/%any 和ifconfig得到的内网ip,这里注意一下
验证
sysctl -p
service ipsec start
ipsec verify
可用的时候是这样的
yum install iptables-services
systemctl enable iptables
COMMIT 注意要有换行
xl2tpd -D &
service iptables restart
ipsec restart
----------------ubuntu14.04 aws
设置root的ssh
------------------------------------------------------------
------------------------------------------------------------
ubuntu14.04参考
https://raymii.org/s/tutorials/IPSEC_L2TP_vpn_with_Ubuntu_14.04.html
apt-get install iptables-persistent
apt-get install ppp openswan xl2tpd
也没好使
http://crazyof.me/blog/archives/610.html
http://www.enjoydiy.com/213.html
http://ubuntuforums.org/showthread.php?t=2211939
vim /etc/ipsec.conf
注意,left为内网ifconfig的ip,leftprotoport=17/%any 一定要这么写,写成1701会报错
cat /etc/rc.local
cat /etc/iptables/rules.v4
cat /etc/xl2tpd/xl2tpd.conf
网段和iptables配置的网段要一样,不能是已经存在的网段
cat /etc/ppp/chap-secrets
useradd hey
passwd hey
heyman
cat /etc/ipsec.secrets
ip为ifconfig的内网ip
设置
/etc/sysctl.conf 上面
sysctl -p
/etc/init.d/iptables-persistent restart
service ipsec restart
servcie xl2tpd restart
tailf /var/log/secure 看访问的log
r如果有尝试密码的使用
/etc/hosts.deny
all:218.87.111.110
禁止
iphone访问的话
https://www.jianshu.com/p/e772ffc22e77
配置完客户端要加路由....???
最新的为https://www.iteye.com/blog/haoningabc-2480610
2018年2月14日更新:
aws的ip为172.31.26.41
iptables -t nat -A POSTROUTING -s 172.31.26.0/24 -o eth0 -j MASQUERADE
然后按照
http://blog.csdn.net/kitvv/article/details/50696585
操作
psk的那个secure文件改成
13.115.181.153 %any: PSK "haha"
################
在aws上建立rhel7.1的虚拟机
PermitRootLogin yes
PasswordAuthentication yes
[ec2-user@ip-172-31-17-111 ~]$ cat /etc/ssh/sshd_config # $OpenBSD: sshd_config,v 1.93 2014/01/10 05:59:19 djm Exp $ # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information. # This sshd was compiled with PATH=/usr/local/bin:/usr/bin # The strategy used for options in the default sshd_config shipped with # OpenSSH is to specify options with their default value where # possible, but leave them commented. Uncommented options override the # default value. # If you want to change the port on a SELinux system, you have to tell # SELinux about this change. # semanage port -a -t ssh_port_t -p tcp #PORTNUMBER # #Port 22 #AddressFamily any #ListenAddress 0.0.0.0 #ListenAddress :: # The default requires explicit activation of protocol 1 #Protocol 2 # HostKey for protocol version 1 #HostKey /etc/ssh/ssh_host_key # HostKeys for protocol version 2 HostKey /etc/ssh/ssh_host_rsa_key #HostKey /etc/ssh/ssh_host_dsa_key HostKey /etc/ssh/ssh_host_ecdsa_key HostKey /etc/ssh/ssh_host_ed25519_key # Lifetime and size of ephemeral version 1 server key #KeyRegenerationInterval 1h #ServerKeyBits 1024 # Ciphers and keying #RekeyLimit default none # Logging # obsoletes QuietMode and FascistLogging #SyslogFacility AUTH SyslogFacility AUTHPRIV #LogLevel INFO # Authentication: #LoginGraceTime 2m PermitRootLogin yes #StrictModes yes #MaxAuthTries 6 #MaxSessions 10 #RSAAuthentication yes #PubkeyAuthentication yes # The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2 # but this is overridden so installations will only check .ssh/authorized_keys AuthorizedKeysFile .ssh/authorized_keys #AuthorizedPrincipalsFile none #AuthorizedKeysCommand none #AuthorizedKeysCommandUser nobody # For this to work you will also need host keys in /etc/ssh/ssh_known_hosts #RhostsRSAAuthentication no # similar for protocol version 2 #HostbasedAuthentication no # Change to yes if you don't trust ~/.ssh/known_hosts for # RhostsRSAAuthentication and HostbasedAuthentication #IgnoreUserKnownHosts no # Don't read the user's ~/.rhosts and ~/.shosts files #IgnoreRhosts yes # To disable tunneled clear text passwords, change to no here! PasswordAuthentication yes #PermitEmptyPasswords no #PasswordAuthentication no # Change to no to disable s/key passwords #ChallengeResponseAuthentication yes ChallengeResponseAuthentication no # Kerberos options #KerberosAuthentication no #KerberosOrLocalPasswd yes #KerberosTicketCleanup yes #KerberosGetAFSToken no #KerberosUseKuserok yes # GSSAPI options GSSAPIAuthentication yes GSSAPICleanupCredentials no #GSSAPIStrictAcceptorCheck yes #GSSAPIKeyExchange no #GSSAPIEnablek5users no # Set this to 'yes' to enable PAM authentication, account processing, # and session processing. If this is enabled, PAM authentication will # be allowed through the ChallengeResponseAuthentication and # PasswordAuthentication. Depending on your PAM configuration, # PAM authentication via ChallengeResponseAuthentication may bypass # the setting of "PermitRootLogin without-password". # If you just want the PAM account and session checks to run without # PAM authentication, then enable this but set PasswordAuthentication # and ChallengeResponseAuthentication to 'no'. # WARNING: 'UsePAM no' is not supported in Red Hat Enterprise Linux and may cause several # problems. UsePAM yes #AllowAgentForwarding yes #AllowTcpForwarding yes #GatewayPorts no X11Forwarding yes #X11DisplayOffset 10 #X11UseLocalhost yes #PermitTTY yes #PrintMotd yes #PrintLastLog yes #TCPKeepAlive yes #UseLogin no UsePrivilegeSeparation sandbox # Default for new installations. #PermitUserEnvironment no #Compression delayed ClientAliveInterval 0 #ClientAliveCountMax 3 #ShowPatchLevel no #UseDNS yes #PidFile /var/run/sshd.pid #MaxStartups 10:30:100 #PermitTunnel no #ChrootDirectory none #VersionAddendum none # no default banner path #Banner none # Accept locale-related environment variables AcceptEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES AcceptEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT AcceptEnv LC_IDENTIFICATION LC_ALL LANGUAGE AcceptEnv XMODIFIERS # override default of no subsystems Subsystem sftp /usr/libexec/openssh/sftp-server # Example of overriding settings on a per-user basis #Match User anoncvs # X11Forwarding no # AllowTcpForwarding no # PermitTTY no # ForceCommand cvs server [ec2-user@ip-172-31-17-111 ~]$
参考
http://www.esojourn.org/blog/post/setup-l2tp-vpn-server-with-ipsec-in-centos6.php?page=2&part=1
使用xl2tp和ipsec,ppp让iphone和mac上网
注意的地方
1.尽量用新版本
2.配置的vpn用户名密码要是系统能登录的
3.http://pkgs.org/centos-7/nux-dextop-x86_64/xl2tpd-1.3.6-2.el7.nux.x86_64.rpm.html
下载对应的系统对应的rpm包 xl2tpd
rpm -ivh xl2tpd-1.3.6-8.el7.x86_64.rpm
4.yum install ppp openswan
openswan就是ipsec
5.我linode的ip是106.187.44.20,要替换下面的ip到你的ip
#!/bin/sh for each in /proc/sys/net/ipv4/conf/* do echo 0 > $each/accept_redirects echo 0 > $each/send_redirects done
[root@localhost ~]# cat /etc/ipsec.conf # /etc/ipsec.conf - Libreswan IPsec configuration file # This file: /etc/ipsec.conf # # Enable when using this configuration file with openswan instead of libreswan #version 2 # # Manual: ipsec.conf.5 # basic configuration config setup # which IPsec stack to use, "netkey" (the default), "klips" or "mast". # For MacOSX use "bsd" oe=off protostack=netkey # # The interfaces= line is only required for the klips/mast stack #interfaces="%defaultroute" #interfaces="ipsec0=eth0 ipsec1=ppp0" # # If you want to limit listening on a single IP - not required for # normal operation #listen=127.0.0.1 # # Do not set debug options to debug configuration issues! # # plutodebug / klipsdebug = "all", "none" or a combation from below: # "raw crypt parsing emitting control kernel pfkey natt x509 dpd # private". # Note: "crypt" is not included with "all", as it can show confidential # information. It must be specifically specified # examples: # plutodebug="control parsing" # plutodebug="all crypt" # Again: only enable plutodebug or klipsdebug when asked by a developer #plutodebug=none #klipsdebug=none # # Normally, pluto logs via syslog. If you want to log to a file, # specify below or to disable logging, eg for embedded systems, use # the file name /dev/null # Note: SElinux policies might prevent pluto writing to a log file at # an unusual location. #plutostderrlog=/var/log/pluto.log # # Enable core dumps (might require system changes, like ulimit -C) # This is required for abrtd to work properly # Note: SElinux policies might prevent pluto writing the core at # unusual locations dumpdir=/var/run/pluto/ # # NAT-TRAVERSAL support # exclude networks used on server side by adding %v4:!a.b.c.0/24 # It seems that T-Mobile in the US and Rogers/Fido in Canada are # using 25/8 as "private" address space on their wireless networks. # This range has not been announced via BGP (at least upto 2010-12-21) nat_traversal=yes virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12,%v4:25.0.0.0/8,%v4:100.64.0.0/10,%v6:fd00::/8,%v6:fe80::/10 # Add connections here # For example connections, see your distribution's documentation directory, # or the documentation which could be located at # /usr/share/docs/libreswan-3.*/ or look at https://www.libreswan.org/ # # There is also a lot of information in the manual page, "man ipsec.conf" # You may put your configuration (.conf) file in the "/etc/ipsec.d/" directory # by uncommenting this line #include /etc/ipsec.d/*.conf conn L2TP-PSK-NAT rightsubnet=vhost:%priv also=L2TP-PSK-noNAT conn L2TP-PSK-noNAT authby=secret pfs=no auto=add keyingtries=3 rekey=no ikelifetime=8h keylife=1h type=transport left=172.31.17.111 # leftid=52.74.143.66 # leftprotoport=17/1701 leftprotoport=17/%any right=%any right=%any
17/%any 和ifconfig得到的内网ip,这里注意一下
[root@localhost ~]# cat /etc/ipsec.secrets include /etc/ipsec.d/*.secrets 106.187.44.20 %any: PSK "haha"
[root@localhost ~]# cat /etc/sysctl.conf # System default settings live in /usr/lib/sysctl.d/00-system.conf. # To override those settings, enter new settings here, or in an /etc/sysctl.d/<name>.conf file # # For more information, see sysctl.conf(5) and sysctl.d(5). net.ipv4.ip_forward = 1 net.ipv4.conf.default.rp_filter = 0 net.ipv4.conf.eth0.rp_filter = 0 net.ipv4.conf.all.send_redirects = 0 net.ipv4.conf.default.send_redirects = 0 net.ipv4.conf.all.log_martians = 0 net.ipv4.conf.default.log_martians = 0 net.ipv4.conf.default.accept_source_route = 0 net.ipv4.conf.all.accept_redirects = 0 net.ipv4.conf.default.accept_redirects = 0 net.ipv4.icmp_ignore_bogus_error_responses = 1
验证
sysctl -p
service ipsec start
ipsec verify
可用的时候是这样的
[root@localhost ~]# ipsec verify Verifying installed system and configuration files Version check and ipsec on-path [OK] Libreswan 3.8 (netkey) on 3.15.4-x86_64-linode45 Checking for IPsec support in kernel [OK] NETKEY: Testing XFRM related proc values ICMP default/send_redirects [OK] ICMP default/accept_redirects [OK] XFRM larval drop [OK] Pluto ipsec.conf syntax [OK] Hardware random device [N/A] Two or more interfaces found, checking IP forwarding [OK] Checking rp_filter [OK] Checking that pluto is running [OK] Pluto listening for IKE on udp 500 [OK] Pluto listening for IKE/NAT-T on udp 4500 [OK] Pluto ipsec.secret syntax [OK] Checking NAT and MASQUERADEing [TEST INCOMPLETE] Checking 'ip' command [OK] Checking 'iptables' command [OK] Checking 'prelink' command does not interfere with FIPSChecking for obsolete ipsec.conf options [OK] Opportunistic Encryption [DISABLED] [root@localhost ~]#
[color=red]listen-addr 注意这里的ip如果外网不通就用内网的[/color] [root@localhost ~]# cat /etc/xl2tpd/xl2tpd.conf ; ; This is a minimal sample xl2tpd configuration file for use ; with L2TP over IPsec. ; ; The idea is to provide an L2TP daemon to which remote Windows L2TP/IPsec ; clients connect. In this example, the internal (protected) network ; is 192.168.1.0/24. A special IP range within this network is reserved ; for the remote clients: 192.168.1.128/25 ; (i.e. 192.168.1.128 ... 192.168.1.254) ; ; The listen-addr parameter can be used if you want to bind the L2TP daemon ; to a specific IP address instead of to all interfaces. For instance, ; you could bind it to the interface of the internal LAN (e.g. 192.168.1.98 ; in the example below). Yet another IP address (local ip, e.g. 192.168.1.99) ; will be used by xl2tpd as its address on pppX interfaces. [global] ;listen-addr = 106.187.44.20 ;ipsec saref = no ; ; requires openswan-2.5.18 or higher - Also does not yet work in combination ; with kernel mode l2tp as present in linux 2.6.23+ ; ipsec saref = yes ; Use refinfo of 22 if using an SAref kernel patch based on openswan 2.6.35 or ; when using any of the SAref kernel patches for kernels up to 2.6.35. ; saref refinfo = 30 ; ; force userspace = yes ; ; debug tunnel = yes [lns default] ip range = 192.168.1.128-192.168.1.254 local ip = 192.168.1.99 require chap = yes refuse pap = yes require authentication = yes name = LinuxVPNserver ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd length bit = yes
[root@localhost ~]# cat /etc/ppp/options.xl2tpd require-mschap-v2 ipcp-accept-local ipcp-accept-remote #ms-dns 106.187.36.20 ms-dns 8.8.4.4 ms-dns 8.8.8.8 # ms-dns 192.168.1.1 # ms-dns 192.168.1.3 # ms-wins 192.168.1.2 # ms-wins 192.168.1.4 noccp auth crtscts idle 1800 mtu 1410 mru 1410 nodefaultroute debug lock proxyarp connect-delay 5000 # To allow authentication against a Windows domain EXAMPLE, and require the # user to be in a group "VPN Users". Requires the samba-winbind package # require-mschap-v2 # plugin winbind.so # ntlm_auth-helper '/usr/bin/ntlm_auth --helper-protocol=ntlm-server-1 --require-membership-of="EXAMPLE\\VPN Users"' # You need to join the domain on the server, for example using samba: # http://rootmanager.com/ubuntu-ipsec-l2tp-windows-domain-auth/setting-up-openswan-xl2tpd-with-native-windows-clients-lucid.html
[root@localhost ~]# cat /etc/ppp/chap-secrets # Secrets for authentication using CHAP # client server secret IP addresses root * 我的密码 *
yum install iptables-services
systemctl enable iptables
[root@localhost ~]# cat /etc/sysconfig/iptables *nat :PREROUTING ACCEPT [39:3503] :POSTROUTING ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j MASQUERADE COMMIT *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] :OUTPUT ACCEPT [121:13264] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 1194 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 1701 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 500 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 4500 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -d 192.168.1.0/24 -j ACCEPT -A FORWARD -s 192.168.1.0/24 -j ACCEPT -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT
COMMIT 注意要有换行
xl2tpd -D &
service iptables restart
ipsec restart
----------------ubuntu14.04 aws
设置root的ssh
ssh出现permission denied (publickey)问题: 修改/etc/ssh/sshd-config文件. 将其中的PermitRootLogin no修改为yes PubkeyAuthentication yes修改为no AuthorizedKeysFile .ssh/authorized_keys前面加上#屏蔽掉, PasswordAuthentication no修改为yes就可以了。 重启sshd即可:service sshd restart
------------------------------------------------------------
------------------------------------------------------------
ubuntu14.04参考
https://raymii.org/s/tutorials/IPSEC_L2TP_vpn_with_Ubuntu_14.04.html
apt-get install iptables-persistent
apt-get install ppp openswan xl2tpd
也没好使
http://crazyof.me/blog/archives/610.html
http://www.enjoydiy.com/213.html
http://ubuntuforums.org/showthread.php?t=2211939
"I also make it my habit to make leftprotoport 17/%any instead of 17/1701"
vim /etc/ipsec.conf
config setup nat_traversal=yes virtual_private=%v4:10.0.0.0/8,%v4:192.168.0.0/16,%v4:172.16.0.0/12 oe=off protostack=netkey conn L2TP-PSK-NAT rightsubnet=vhost:%priv also=L2TP-PSK-noNAT conn L2TP-PSK-noNAT authby=secret pfs=no auto=add keyingtries=3 rekey=no ikelifetime=8h keylife=1h type=transport left=172.31.30.234 leftprotoport=17/%any right=%any rightprotoport=17/%any
注意,left为内网ifconfig的ip,leftprotoport=17/%any 一定要这么写,写成1701会报错
cat /etc/rc.local
iptables --table nat --append POSTROUTING --jump MASQUERADE echo 1 > /proc/sys/net/ipv4/ip_forward for each in /proc/sys/net/ipv4/conf/* do echo 0 > $each/accept_redirects echo 0 > $each/send_redirects done exit 0
cat /etc/iptables/rules.v4
# Generated by iptables-save v1.4.21 on Mon Nov 24 04:44:08 2014 #*filter #:INPUT ACCEPT [0:0] #:FORWARD ACCEPT [0:0] #:OUTPUT ACCEPT [0:0] #COMMIT # Completed on Mon Nov 24 04:44:08 2014 # sample configuration for iptables service # you can edit this manually or use system-config-firewall # please do not ask us to add additional ports/services to this default configuration *nat :PREROUTING ACCEPT [39:3503] :POSTROUTING ACCEPT [0:0] :OUTPUT ACCEPT [0:0] -A POSTROUTING -s 192.168.3.0/24 -o eth0 -j MASQUERADE COMMIT *filter :INPUT ACCEPT [0:0] :FORWARD ACCEPT [0:0] #:OUTPUT ACCEPT [0:0] :OUTPUT ACCEPT [121:13264] -A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT -A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 53 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 53 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 1194 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 1701 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 500 -j ACCEPT -A INPUT -p tcp -m state --state NEW -m tcp --dport 500 -j ACCEPT -A INPUT -p udp -m state --state NEW -m udp --dport 4500 -j ACCEPT -A INPUT -j REJECT --reject-with icmp-host-prohibited -A FORWARD -d 192.168.3.0/24 -j ACCEPT -A FORWARD -s 192.168.3.0/24 -j ACCEPT -A FORWARD -j REJECT --reject-with icmp-host-prohibited COMMIT
cat /etc/xl2tpd/xl2tpd.conf
[global] ipsec saref = no [lns default] ip range = 192.168.3.128-192.168.3.254 local ip = 192.168.3.1 require chap = yes refuse pap = yes require authentication = yes ppp debug = yes pppoptfile = /etc/ppp/options.xl2tpd length bit = yes
网段和iptables配置的网段要一样,不能是已经存在的网段
cat /etc/ppp/chap-secrets
# Secrets for authentication using CHAP # client server secret IP addresses hey * heyman *
useradd hey
passwd hey
heyman
cat /etc/ipsec.secrets
root@ip-172-31-30-234:/home/ubuntu# cat /etc/ipsec.secrets # This file holds shared secrets or RSA private keys for inter-Pluto # authentication. See ipsec_pluto(8) manpage, and HTML documentation. # RSA private key for this host, authenticating it to any other host # which knows the public part. Suitable public keys, for ipsec.conf, DNS, # or configuration of other implementations, can be extracted conveniently # with "ipsec showhostkey". # this file is managed with debconf and will contain the automatically created RSA keys #include /var/lib/openswan/ipsec.secrets.inc 172.31.30.234 %any: PSK "haha"
root@ip-172-31-30-234:/data/meatspace-chat# cat /etc/ppp/options.xl2tpd require-mschap-v2 ms-dns 8.8.8.8 asyncmap 0 auth crtscts lock hide-password modem debug name l2tpd proxyarp lcp-echo-interval 30 lcp-echo-failure 4
ip为ifconfig的内网ip
设置
/etc/sysctl.conf 上面
sysctl -p
/etc/init.d/iptables-persistent restart
service ipsec restart
servcie xl2tpd restart
tailf /var/log/secure 看访问的log
r如果有尝试密码的使用
/etc/hosts.deny
all:218.87.111.110
禁止
iphone访问的话
发表评论
-
xl2tpd的2022.09.12到期
2021-09-16 21:08 11yum install https://dl.fedora ... -
xl2tp 中继器
2021-03-18 16:48 1021参考https://haoningabc.iteye.com/ ... -
aws和tx 双xl2tpd搭建
2020-10-10 20:14 667注意mtu,需要aws和tx各网卡设置成一致的 ifconfi ... -
xl2tp redhat8
2019-12-10 14:04 603####### 例子 ################ ... -
xl2tp转发
2019-10-30 15:44 1022route add -host 172.217.3.164 d ... -
xl2tp 备份
2019-09-24 16:25 6882019年9月24日更新: 注意,需要开启firewall ... -
sdl笔记
2019-01-31 17:19 732sdl教程教程 https://github.com/Twin ... -
tinyemu
2019-01-24 17:59 1432参考https://bellard.org/jslinux/t ... -
aws搭建xl2tp给iphone使用
2018-12-26 21:37 18902019年12月26日 可以参考原来的配置 https:// ... -
consul的基本使用
2017-06-27 11:13 1399### 安装 [centos7上consul的安装](ht ... -
lvs的helloworld
2017-06-13 20:36 596###################lvs######### ... -
系统调用的helloworld
2017-05-04 16:14 632《2.6内核标准教程》 p293 #include < ... -
bitcoin和cgminer的安装
2017-04-05 22:45 1958参考 http://blog.csdn.net/rion_ch ... -
ceph安装和常用命令
2017-03-21 21:55 953/etc/hosts ssh-keygen ssh-copy- ... -
mobile terminal 笔记
2016-12-02 15:35 624找出旧的iphone4 越狱之后可以变个小操作系统 mobi ... -
socket基础和select(python)
2016-06-14 17:21 1799上接 c语言的socket基础ht ... -
socket基础(c语言)
2016-06-14 16:45 994不使用select 普通的基础socket连接,对多个客户端的 ... -
ffmpeg+nginx 的直播(2,直播摄像头和麦克风)
2016-05-28 20:21 4357假设我的服务器是centos7 192.168.139.117 ... -
ffmpeg+nginx 的直播(1,直播播放的视频文件)
2016-05-26 17:11 659164位操作系统centos7 ############ 1.一 ... -
socat和netcat(nc)
2016-04-29 22:36 1742转 原文链接: http://www.wenquan.name ...
相关推荐
Linode VPS 也可以部署 CentOS 7,已经定制过,包含了常用的但是在 7 版中已经废弃的指令,如ifconfig、netstat、iptables 等。 7. 网络连接的状态 可以使用 ip addr、ip link 等命令来查看网络连接的状态,包括 IP...
最近在Linode上弄Python、出现ValueError: zero length field name in format这样的错误; 翻看文档之后发现只要升级Python到2.7以上版本就能解决问题。 用 Pythno -V 看了一下目前Centos上的版本是2.6的。 CentOS6...
[Ubuntu][Linux][教學]_安裝設定#04_在Linode_VPS上架設Ubuntu
Linode linode是(大部分)完整的Go绑定到集合。 它不是特别惯用的。 目标是按照书面形式匹配API,而不是对其进行Go-ify。安装假设您有一个可以运行的Go环境: $ go get github.com/alexsacr/linode用法关于您的期望...
Api-linode_api4-python.zip,linode apilinode_api4的正式python绑定,一个api可以被认为是多个软件设备之间通信的指导手册。例如,api可用于web应用程序之间的数据库通信。通过提取实现并将数据放弃到对象中,api...
《Python库:linode_cli-3.1.1-py2.py3-none-any.whl的详解与应用》 在Python的开发过程中,我们经常会利用各种库来提高开发效率和代码质量。今天我们要深入探讨的是一款名为`linode-cli`的Python库,其对应的安装...
linode4j Linode API的Java实现 ##特征 干净,简单的数据访问层和数据对象。 轻松区分必需参数和可选参数。 线程安全的类似Spring的基于模板的数据访问对象。 通过Jackson的超快速序列化。 简化了对所有...
在本教程中,我们将深入探讨如何使用kube-linode项目在Linode云平台上部署一个基于CoreOS的Kubernetes集群。Kubernetes(简称K8s)是一个开源的容器编排系统,用于自动化容器化应用的部署、扩展和管理。CoreOS是专为...
自从 Linux 4.3 开始,在 Linode 上使用 PaX/grsecurity 时,内核会在被 pv-grub 执行后不久立即崩溃。由于崩溃是在启动后极早期立刻发生的,没有任何可以用来调试的日志,同时公司也不是盖子开的,也没有办法得到母...
消极Go库,用于与Linode API进行交互。 。用法导入方式: import github.com/LunaNode/go-linode并用作linode: apiKey := "myKey"client := linode.NewClient(apiKey)linodeID, err := client.CreateLinode(6, 1) /...
《Python库:linode_api4-5.1.0-py3-none-any.whl的深度解析》 在Python的世界里,库是开发者的重要工具,它们提供了丰富的功能,简化了编程工作。今天我们要深入探讨的是一个名为`linode_api4`的Python库,版本号...
在 Linode 上部署 CoreOS 通过这项工作,您可以轻松地在上部署 。 至于今天(2015 年 1 月)CoreOS 在 Linode 上不可用。 通过这项工作,您可以使用自己的云配置轻松快速地部署 CoreOS。 安装(使用 Docker) 这是...
linode-dns-工具 用于的工具集合。 要求 您必须提供您的 linode API 密钥,您可以通过您的 linode 配置文件生成该密钥。 如果当前目录中有.linode-key文件,则使用它,否则使用主目录中的.linode-key文件。 安装 ...
Linode预配器这是一个bash脚本,它创建一个新的并进行一些基本配置。 每次我想要一台新服务器时,我基本上都厌倦了使用Web界面创建Linodes并执行相同的基本设置步骤(创建用户,上载ssh密钥,禁用root登录等)。 ...
docker-machine-driver-linode 适用于docker-machine的Linode驱动程序插件。安装docker-machine是必需的,。 然后,从为您的环境安装最新版本。从源安装如果你宁愿从源代码编译,你需要有一个工作go 1.11+环境, ...
ansible-linode-nodebalancer Ansible模块来创建/更新/删除Linode Nodebalancers 要使Ansible能够读取此模块,您必须将其放在“库”文件夹中,并通过编辑ansible.cfg-( )来让ansible知道它在哪里。 安装示例 ...
`certbot_dns_linode-0.37.2-py2.py3-none-any.whl` 是一个Python库的轮子文件,它专为自动化证书管理工具Certbot设计,用于与Linode DNS API集成,以便在Linode的DNS服务上自动配置和验证域名以获取Let's Encrypt的...
docker-machine-linode 适用于docker-machine的Linode驱动程序插件。 需要docker-machine版本> v.0.5.0-rc1 安装 首先,需要搬运工机v0.5.0 RC2,对于如何安装文件docker-machine。 或者您可以通过运行以下命令从...
指示在 Linode 的 DNS 管理器中创建 A 记录。 下载脚本: $ git clone https://github.com/andrewchilds/linode-dyn-dns $ cd linode-dyn-dns设置您的 API 密钥,可在找到: $ echo MY_API_KEY > .key获取您的域 ID ...
_ _ _ ___ ______ _____ | | (_) | | / _ \ | ___ \_ ...适用于PHP的v4.01 Linode API [测试版]。 绝对是一项正在进行的工作。 不使用。 该软件包由澳大利亚机器人开发商H&H | Digital开发。 请访问访问我们。 该软