KVM Debian-禁用ICMP重定向接受使SSH和ping不可能
根据本教程,我目前正在Debian KVM上设置VPN LT2P/IPSec: 发出此命令: root@localhost:~ipsec验证 我得到了以下输出KVM Debian-禁用ICMP重定向接受使SSH和ping不可能,ssh,debian,ping,kvm,icmp,Ssh,Debian,Ping,Kvm,Icmp,根据本教程,我目前正在Debian KVM上设置VPN LT2P/IPSec: 发出此命令: root@localhost:~ipsec验证 我得到了以下输出 Checking your system to see if IPsec got installed and started correctly: Version check and ipsec on-path [OK] Linux Openswan U2.6.28/K2.6.32
Checking your system to see if IPsec got installed and started correctly:
Version check and ipsec on-path [OK]
Linux Openswan U2.6.28/K2.6.32-5-686 (netkey)
Checking for IPsec support in kernel [OK]
NETKEY detected, testing for disabled ICMP send_redirects [FAILED]
Please disable /proc/sys/net/ipv4/conf/*/send_redirects
or NETKEY will cause the sending of bogus ICMP redirects!
NETKEY detected, testing for disabled ICMP accept_redirects [FAILED]
Please disable /proc/sys/net/ipv4/conf/*/accept_redirects
or NETKEY will accept bogus ICMP redirects!
Checking that pluto is running [OK]
Pluto listening for IKE on udp 500 [FAILED]
Cannot execute command "lsof -i UDP:500": No such file or directory
Pluto listening for NAT-T on udp 4500 [FAILED]
Cannot execute command "lsof -i UDP:4500": No such file or directory
Checking for 'ip' command [OK]
Checking for 'iptables' command [OK]
Opportunistic Encryption Support [DISABLED]
因此,我在/etc/sysctl.conf中将此设置编辑为
禁用ICMP重定向接受
net.ipv4.conf.all.accept_重定向=0
然后我在/etc/init.d中重新启动了网络
现在我的问题来了:我不能再通过SSH连接到我的KVM,也不能ping ip。我唯一能用的就是VNC
如何在不启用ICMP重定向接受的情况下通过SSH再次连接?如果您刚刚执行了/etc/init.d/networking restart,请确保您的接口已启动,例如使用ifconfig。当我像Debian wheezy那样重新启动网络时,它说:
不推荐运行/etc/init.d/networking restart,因为它可能会
无法重新启用某些接口。。。警告
事实上,我确实发现我需要重新启动eth0,因为它也应该工作
我认为你的问题与ICMP重定向无关。我在运行wheezy的KVM实例上禁用了它,它接受ping和ssh。如果不是上述问题,那么我会怀疑您的IPsec配置中存在错误并破坏了netfilter。如果您刚刚执行了/etc/init.d/networking restart,请确保您的接口已启动,例如使用ifconfig。当我像Debian wheezy那样重新启动网络时,它说:
不推荐运行/etc/init.d/networking restart,因为它可能会
无法重新启用某些接口。。。警告
事实上,我确实发现我需要重新启动eth0,因为它也应该工作
我认为你的问题与ICMP重定向无关。我在运行wheezy的KVM实例上禁用了它,它接受ping和ssh。如果不是上述问题,我会怀疑您的IPsec配置中存在错误并破坏了netfilter。我从github gist中找到了解决方案:
我从github gist找到了解决方案: 被否决。正如上面所说的,我们鼓励链接到外部资源,但是请在链接周围添加上下文,这样您的其他用户就会知道它是什么以及为什么会在那里。始终引用重要链接中最相关的部分,以防无法访问目标站点或永久脱机。Downvoted。正如上面所说的,我们鼓励链接到外部资源,但是请在链接周围添加上下文,这样您的其他用户就会知道它是什么以及为什么会在那里。始终引用重要链接中最相关的部分,以防无法访问目标站点或永久脱机。