我有一台运行SNMP池程序的Debian机器,但在让池程序使用特定接口时遇到了问题。
Debian机器有3个接口。
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)?
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发布于 2015-07-19 01:10:36
正如迈克尔·汉普顿在关于OP的评论中提到的,我调整了我的接口文件以使用一个带有多个IP的接口。
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现在,它从第一个主地址发送请求。
https://serverfault.com/questions/706747
复制相似问题