AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / user-151169

haelix's questions

Martin Hope
haelix
Asked: 2021-05-18 09:39:24 +0800 CST

多宿主:我是否需要 2 个接口的路由指标,其中只有一个可以访问互联网?

  • 0

我有 2 台多宿主服务器,它们除了通过它们的一个 NIC 连接到 Internet 之外,它们还通过它们的第二个 NIC 彼此背靠背连接。

我systemd-networkd用于为 Internet 链接配置 DHCP,并为它们的交叉连接配置链接本地 IP。交叉连接配置文件如下所示:

$ less /etc/systemd/network/25-other.network
[Match]
Name=eth5

[Network]
LinkLocalAddressing=yes

这是可行的,并且服务器在其辅助接口上分别分配了 169.254.245.165/16 之类的 IP。

对路由不是很熟悉,我想知道我是否会因为路由而遇到 Internet 连接问题。内核是否曾经尝试通过辅助接口访问互联网?决定是如何做出的?我知道可以为此使用路由指标,但不确定我是否需要它们(因为两个接口都没有可用的目的地),所以我需要这个吗?

[Network]
Metric=20

或者也许这个?

[Network]
RouteMetric=20

编辑:正如接受的答案所说,没有添加路线一切都很好。发布ip route是否对任何人有帮助的输出。它显示了通过我的路由器的默认路由和通过链接本地 IP 的第二条路由。

default via 192.168.2.1 dev enp111s0 proto dhcp src 192.168.2.11 metric 1024 
169.254.0.0/16 dev enpa1a2 proto kernel scope link src 169.254.2.11 
routing metrics multi-homed
  • 1 个回答
  • 190 Views
Martin Hope
haelix
Asked: 2021-05-15 12:31:09 +0800 CST

我的网络接口更改了名称,因此 DHCP / dhclient 无法对其进行操作

  • 2

在一些 ArchLinux 服务器上,我已从 切换dhcpcd到dhclient,但服务器没有收到 IP。经过检查,journalctl我看到,在所有情况下都没有收到 IP,dhclient试图在接口上操作,然后接口被重命名。有问题的行是:

dhclient[461]: Failed to get interface index: No such device
...
kernel: igc 0000:6f:00.0 enp111s0: renamed from eth1

这个“接口重命名”业务是什么?怎么可能dhclient没有围绕它进行排序?

当然,稍后,以下命令会修复 DHCP:

sudo systemctl restart dhclient@enp111s0.service

更多日志:

May 14 19:03:32 serverski systemd[1]: Reached target Multi-User System.
May 14 19:03:32 serverski systemd[1]: Reached target Graphical Interface.
May 14 19:03:32 serverski dhclient[487]: Cannot find device "enp111s0"
May 14 19:03:32 serverski dhclient[461]: Failed to get interface index: No such device
May 14 19:03:32 serverski dhclient[461]: Failed to get interface index: No such device
May 14 19:03:32 serverski dhclient[461]: If you think you have received this message due to a bug rather
May 14 19:03:32 serverski dhclient[461]: than a configuration issue please read the section on submitting
May 14 19:03:32 serverski dhclient[461]: bugs on either our web page at www.isc.org or in the README file
May 14 19:03:32 serverski dhclient[461]: before submitting a bug.  These pages explain the proper
May 14 19:03:32 serverski dhclient[461]: process and the information we find helpful for debugging.
May 14 19:03:32 serverski dhclient[461]: exiting.
May 14 19:03:32 serverski dhclient[461]: 
May 14 19:03:32 serverski dhclient[461]: If you think you have received this message due to a bug rather
May 14 19:03:32 serverski dhclient[461]: than a configuration issue please read the section on submitting
May 14 19:03:32 serverski dhclient[461]: bugs on either our web page at www.isc.org or in the README file
May 14 19:03:32 serverski dhclient[461]: before submitting a bug.  These pages explain the proper
May 14 19:03:32 serverski dhclient[461]: process and the information we find helpful for debugging.
May 14 19:03:32 serverski dhclient[461]: 
May 14 19:03:32 serverski dhclient[461]: exiting.
May 14 19:03:32 serverski systemd-udevd[380]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
May 14 19:03:32 serverski systemd[1]: dhclient@enp111s0.service: Main process exited, code=exited, status=1/FAILURE
May 14 19:03:32 serverski systemd[1]: dhclient@enp111s0.service: Failed with result 'exit-code'.
May 14 19:03:32 serverski audit[1]: SERVICE_STOP pid=1 uid=0 auid=4294967295 ses=4294967295 msg='unit=dhclient@enp111s0 comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=fail>
May 14 19:03:32 serverski systemd-udevd[427]: Using default interface naming scheme 'v247'.
May 14 19:03:32 serverski systemd-udevd[427]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
May 14 19:03:32 serverski kernel: r8169 0000:70:00.1 enp112s0f1: renamed from eth0
May 14 19:03:32 serverski kernel: iTCO_vendor_support: vendor-support=0
May 14 19:03:32 serverski systemd-udevd[382]: Using default interface naming scheme 'v247'.
May 14 19:03:32 serverski systemd-udevd[382]: ethtool: autonegotiation is unset or enabled, the speed and duplex are not writable.
May 14 19:03:32 serverski kernel: ee1004 0-0051: 512 byte EE1004-compliant SPD EEPROM, read-only
May 14 19:03:32 serverski kernel: ee1004 0-0053: 512 byte EE1004-compliant SPD EEPROM, read-only
May 14 19:03:32 serverski kernel: igc 0000:6f:00.0 enp111s0: renamed from eth1
networking dhcp ip ethernet dhclient
  • 1 个回答
  • 421 Views
Martin Hope
haelix
Asked: 2020-10-05 15:34:11 +0800 CST

StrictHostKeyChecking=不管我做什么都问不工作

  • 0

这感觉像是一个新手问题,但是在更改主机后我无法登录到我的 ssh 服务器嘿,尽管到处乱扔 StrictHostKeyChecking=no 或 StrictHostKeyChecking=ask 。

我想要的行为是被问及密钥不匹配的问题,并且能够说“是”让 ssh 覆盖已知密钥并继续前进。我觉得这曾经是默认行为!

  • /etc/ssh/ssh_config 没有 StrictHostKeyChecking(已被注释掉)。按照手册的默认值是询问,这应该是我想要的
  • ~/.ssh/config 没有 StrictHostKeyChecking 配置
  • 我尝试在命令行上设置 StrictHostKeyChecking=ask 和 StrictHostKeyChecking=no ,结果令人费解:

在 cmdline 上使用 StrictHostKeyChecking=ask,我从来没有被问到。我被告知以下内容,并且连接失败:

ECDSA host key for localhost has changed and you have requested strict checking.
Host key verification failed.

在命令行上使用 StrictHostKeyChecking=no 时,连接已建立但已瘫痪,说:

Password authentication is disabled to avoid man-in-the-middle attacks.
Keyboard-interactive authentication is disabled to avoid man-in-the-middle attacks.
X11 forwarding is disabled to avoid man-in-the-middle attacks.

这并不快乐,因为我需要 X 转发。

所以总结一下 - 仅在 cmdline 上添加选项似乎有所不同,但我仍然没有被问到。在 /etc/ssh/ssh_config 或 ~/.ssh/config 中添加选项没有区别。为什么是这样?是因为我试图使用 X 吗?不,即使禁用了 X,我也不会被问到。是因为一些服务器端配置吗?(sshd)

ssh ssh-keys
  • 1 个回答
  • 7039 Views
Martin Hope
haelix
Asked: 2018-09-26 03:53:49 +0800 CST

如何禁用 Amazon EC2 实例 yum 自动夜间检查更新?

  • 6

在我的 EC2 实例 (Amazon Linux AMI) 上运行的服务器每晚都会发生故障。我watch编辑了进程,并且每次在此命令运行几分钟后都会发生这种情况:

/usr/bin/python2.7 /usr/bin/yum --debuglevel 2 --security check-update

问:这个配置在哪里运行?我想禁用它,并手动进行更新。

额外问:check-update实际上做什么?它似乎只编译了更新列表,但实际上并没有更新?那有什么意义呢?

amazon-web-services
  • 1 个回答
  • 3859 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve