首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Debian默认界面?

Debian默认界面?
EN

Server Fault用户
提问于 2015-07-18 11:12:00
回答 1查看 484关注 0票数 1

我有一台运行SNMP池程序的Debian机器,但在让池程序使用特定接口时遇到了问题。

Debian机器有3个接口。

代码语言:javascript
复制
allow-hotplug eth0
iface eth0 inet static
    address 10.1.1.3
    netmask 255.255.255.0
    gateway 10.1.1.1
    dns-nameservers 10.1.1.6

allow-hotplug eth1
iface eth1 inet static
    address 10.1.1.7
    netmask 255.255.255.0

allow-hotplug eth2
iface eth2 inet static
    address 10.1.1.8
    netmask 255.255.255.0

在此机器试图从其获取SNMP的客户端计算机上,它将允许来自10.1.1.3的SNMP请求,但由于某种原因,当Debian发送请求时,它将使用10.1.1.7 (eth1)。我还注意到,当我从Debian机器平客户机(10.1.1.5)时,Wireshark说ICMP数据包来自10.1.1.7。为什么它不使用列表中的第一个接口(10.1.1.3)?

路由:

代码语言:javascript
复制
Kernel IP routing table
Destination     Gateway      Genmask         Flags Metric Ref  Use  Iface
default         10.1.1.1     0.0.0.0         UG    0      0      0  eth0
localnet        *            255.255.255.0   U     0      0      0  eth1
localnet        *            255.255.255.0   U     0      0      0  eth0
localnet        *            255.255.255.0   U     0      0      0  eth2

其他注释:

EN

回答 1

Server Fault用户

发布于 2015-07-19 01:10:36

正如迈克尔·汉普顿在关于OP的评论中提到的,我调整了我的接口文件以使用一个带有多个IP的接口。

这里是更新的接口:

代码语言:javascript
复制
allow-hotplug eth0
iface eth0 inet static
    address 10.1.1.3
    netmask 255.255.255.0
    gateway 10.1.1.1
    dns-nameservers 10.1.1.6

allow-hotplug eth1
iface eth0:0 inet static
    address 10.1.1.7
    netmask 255.255.255.0

allow-hotplug eth2
iface eth0:0 inet static
    address 10.1.1.8
    netmask 255.255.255.0

现在,它从第一个主地址发送请求。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/706747

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档