1

I have a Debian machine with an SNMP pooler running, but I am running into an issue with getting the pooler to use a specific interface.

The Debian machine has 3 interfaces

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

On the client machine that this machine is trying to get SNMP info from, it will allow SNMP requests from 10.1.1.3, but for some reason when the Debian sends requests, its using 10.1.1.7 (eth1). I also noticed that when I ping the client (10.1.1.5) from the Debian machine Wireshark says that the ICMP packets are coming from 10.1.1.7. Why wouldn't it use the first interface in the list (10.1.1.3)?

Routes:

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

Other notes:

4
  • 1
    All three of those interfaces appear to be on the same subnet. Is there a reason for this? Jul 18, 2015 at 17:00
  • Yeah, this is a private webserver on a closed network, I read that you can't do multiple SSL sites with Apache on a single IP, so I just snagged two others for the other sites. Jul 19, 2015 at 0:40
  • First, you certainly can have multiple SSL sites on a single IP address. Second, you can have multiple IP addresses on a single interface, so even if you needed multiple IP addresses, there's no reason for you to have multiple interfaces here. Jul 19, 2015 at 0:59
  • Good to know, I used your advice and learned about alias IP's on a single interface! I really should start reading more on the man pages... Jul 19, 2015 at 1:11

1 Answer 1

0

As Michael Hampton mentioned in the comments on the OP, I adjusted my interfaces file to use a single interface with multiple IP's.

Here is the updated interfaces:

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

Now it sends the requests from the first, primary address.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .