Cacti-EZ - Multiple network card installation

The_Librarian

Another MyBB
Super Moderator
Joined
Nov 20, 2015
Messages
41,546
Reaction score
21,126
Location
Dark room in Adventure. Grues abound.
So I've been looking all over the place for a HOWTO on adding extra NIC's onto a Cacti VM (hosted on Hyper-V, Server 2008).

First call was the cacti forums, but these were inaccessible.

So I faffed on over to the CentOS forums, and found nothing that worked for me there as the CentOS install is a very minimal one.

Eventually I stumbled on a method to make things work.

Method :

1. Set up the networking (use legacy network adapters) in the VM settings for Hyper-V. Set up virtual switching if neccessary.
2. Start the VM up so that MAC addresses can be allocated.
3. Write down the MAC address and the zone/IP its network card have to address/access.
For example, my VM have 4 NIC's in :
- eth0 for the Mikrotik interface
- eth1 for the local LAN interface to view traffic graphs etc
- eth2 for the HP core switch management network
- eth3 for the DMZ management network (it have its own ADSL line)

I wrote down the IP I wanted to allocate to that specific card and its MAC address.

4. Fire up the VM, do a default Cacti installation. Don't worry about which interface it will install to, but to make things easier select the one with internet access.
5. Finish off the installation, reboot.
6. Now Cacti should be at the ready to be commanded. SSH/Putty in to it.
7. Do an ifconfig -a to see if every NIC is detected.
8. go to \etc\sysconfig\network-scripts\

I deleted the default ifcfg-xxxx scripts as these was not working for me, and used this template :

Code:
DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.xx.xx
NETMASK=255.255.255.0
HWADDR=00:15:5D:XX:YY:ZZ
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no

Replace the IPADDR and HWADDR with the ones specific to your network.

Then I copied ifcfg-eth0 to ifcfg-eth1 and made the following changes :

Code:
DEVICE=eth1
BOOTPROTO=static
IPADDR=172.0.xx.xx
NETMASK=255.255.255.0
HWADDR=00:15:5D:XA:YB:ZC
NM_CONTROLLED=no
ONBOOT=yes
TYPE=Ethernet
IPV6INIT=no

Then I issued the following commands :

Code:
start_udev
service network restart

and verified that that specific interface is working.

After it is verified working, I copied ifcfg-eth1 to ifcfg-eth2 and repeated the above process, testing.

It is a schlepp, but doing it one-by-one worked for me. I initially tried to go the whole hog and do it in one go, but it tend to screw up things, and then you get eth4 and eth5 instead of eth1 and eth3... :D

Hope this will be of assistance to you sooner or later...
 
Adding static routes is easy

Assuming the following network layout :

[ADSL router]---[CACTI]---[Switch]---[WAN router]---rest of network somewhere in the country

The Cacti PC sits on the 192.168.1.0/24 subnet, while you want to create a static route to 10.0.0.0/24

The router to 10.0.0.0/24 sits on 192.168.1.254

Open /etc/sysconfig/network-scripts/route-eth0 and create/edit it :

Code:
10.0.0.0/24 via 192.168.1.254 dev eth0
(add more routes if needed)

Save the file and exit your editor.

Run

Code:
service network restart

to bring up the network and the route. Ping a remote host on the internal WAN, it should be able to respond if you set it up correctly.
 
Top
Sign up to the MyBroadband newsletter
X