【问题标题】:KVM Debian - Disabling ICMP Redirect Acceptance makes SSH and ping impossibleKVM Debian - 禁用 ICMP 重定向接受使 SSH 和 ping 变得不可能
【发布时间】:2013-05-14 12:38:31
【问题描述】:

我目前正在按照本教程在我的 Debian KVM 上设置 VPN LT2P/IPSec: http://bailey.st/blog/2011/07/06/secure-ipsecl2tp-vpn-for-on-the-road-android-devices/

发出这个命令:

root@localhost:~# ipsec verify

我得到以下输出

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_redirects = 0

然后我在 /etc/init.d 中重新启动了网络

现在我的问题来了:我无法再通过 SSH 连接到我的 KVM,也无法 ping ip。 (我唯一能用的就是VNC)

如何在不启用 ICMP 重定向接受的情况下再次通过 SSH 连接?

【问题讨论】:

    标签: ssh debian ping kvm icmp


    【解决方案1】:

    我从 github gist 找到了解决方案: https://gist.github.com/kryptek/7683862

    【讨论】:

    • 投反对票。正如relevant help page 所说,“鼓励链接到外部资源,但请在链接周围添加上下文,以便您的其他用户了解它是什么以及为什么存在。始终引用重要链接中最相关的部分,在以防目标站点无法访问或永久脱机。”
    【解决方案2】:

    如果您刚刚执行了/etc/init.d/networking restart,请确保您的接口已启动(例如使用ifconfig)。当我在 Debian wheezy 上重新启动网络时,它说:

    运行 /etc/init.d/networking restart 已被弃用,因为它可能 不重新启用某些接口...(警告)

    事实上我确实发现我需要ifup eth0(重启也应该可以)。

    我认为您的问题与 ICMP 重定向无关。我在运行 wheezy 的 KVM 实例上禁用了它,它接受 ping 和 ssh。如果不是上述问题,那么我会怀疑您的 IPsec 配置中有问题并破坏了 netfilter。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-02-25
      • 1970-01-01
      • 2013-03-15
      • 1970-01-01
      • 2020-10-12
      相关资源
      最近更新 更多