Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/ssh/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
OpenSwan L2TP/IPSec sshd绑定地址_Ssh_Vpn_Centos6_Ipsec_L2tp - Fatal编程技术网

OpenSwan L2TP/IPSec sshd绑定地址

OpenSwan L2TP/IPSec sshd绑定地址,ssh,vpn,centos6,ipsec,l2tp,Ssh,Vpn,Centos6,Ipsec,L2tp,好吧,我在谷歌上呆了大约一个小时,想弄明白这一点 我有L2TP/IPSec vpn设置。当客户机连接时,为该客户机创建了一个新接口,问题是在引导过程中,大多数时候这些接口都不存在。我的vpn范围从10.24.1.1开始,我希望sshd在10.24.1.1上侦听,但当没有连接客户端时,它无法绑定地址 /var/log/secure: Apr 15 01:38:26 arija sshd[28068]: error: Bind to port 22 on 10.24.1.1 failed: Cann

好吧,我在谷歌上呆了大约一个小时,想弄明白这一点

我有L2TP/IPSec vpn设置。当客户机连接时,为该客户机创建了一个新接口,问题是在引导过程中,大多数时候这些接口都不存在。我的vpn范围从10.24.1.1开始,我希望sshd在10.24.1.1上侦听,但当没有连接客户端时,它无法绑定地址

/var/log/secure:

Apr 15 01:38:26 arija sshd[28068]: error: Bind to port 22 on 10.24.1.1 failed: Cannot assign requested address.
这是有道理的。我的问题是。有没有办法创建某种类型的虚拟接口,或者只分配10.24.1.1,以便sshd监听它?谢谢你的帮助


服务器也是CentOs 6 64位的

您只需在启动期间向接口添加所需的ip地址即可 配置取决于您使用的linux版本,例如ubuntu的/etc/network/interfaces.d/eth0.cfg。
确保将此地址从用于向L2tP客户端提供IP地址的地址池中排除。

首先,您需要了解,在常见情况下,服务只能在分配了IP的“启动并运行”接口上侦听。这是因为Linux内核的局限性。您可以在运行时使用以下方法更改此行为:

sysctl net.ipv4.ip_nonlocal_bind=1
或者在启动时通过在/etc/sysctl.conf中设置相同的参数:

...
net.ipv4.ip_nonlocal_bind=1
...
但有一种更简单的方法:您可以在其config/etc/ssh/sshd\u config中将sshd绑定到0.0.0.0:

...
ListenAddress 0.0.0.0
...