Changes between Initial Version and Version 1 of netmon2017vmconfig


Ignore:
Timestamp:
Nov 15, 2017, 2:37:56 PM (7 years ago)
Author:
admin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • netmon2017vmconfig

    v1 v1  
     1= Virtual Box and Virtual Machines Configuration =
     2
     3In this Hands-on you will create two seperate ubuntu virtual machines. These VM's will be used to install network monitoring systems and tools.
     4
     5== Setting up the Virtualbox ==
     6
     7=== Installation of virtualbox and Downloading virtual hard disks ===
     8
     9 - Download and install virtualbox 5.0.x​
     10 - Download the Virtual Hard disks from the LEARN mirror. You can get them by following links
     11    * [http://192.248.4.49/ipv6/NetMon.vdi NetMon.vdi]
     12 - Note down the location of downloaded vdi files
     13
     14=== Creating the VM CampusLAN ===
     15
     16 - Start !VirtualBox and Click on '''New''' button (at top-right) to create new virtual machine
     17 - Enter name of the VM as '''NetMon'''
     18 - Select OS Type: '''Linux'''
     19 - Select Version: '''Ubuntu (64-bit)'''
     20 - Then click on Continue button
     21 - Set VM's memory size to '''1024MB''' and click on Continue button
     22 - Set VM's hard disk option to '''Use an existing virtual hard disk file''' and click the browse button and browse to the location where you download the virtual hard disks. Then select the '''NetMon.vdi''' file and click on the create button.
     23 - You will see a new virtual machine named NetMon appears on Virtual Box Manager Window
     24
     25==== Setting up Network Interfaces ====
     26
     27 - Select the NetMon VM from left panel on Virtual box, right click and open '''Settings'''
     28 - Click on the '''Network''' title
     29 - On '''Adapter 1''' check the '''Enable Network Adapter''' . Then change '''Attached to be''' to the '''Bridged Adapter''' and make sure the '''name''' of the interface is the same interface which you use to connect to the outside (Either Wi-Fi or Ethernet). This virtual interface will work as the WAN port of the of your virtual campus network that can be used to connect from out side.
     30 - Click on '''Advanced''' drop down list and change the '''promiscuous mode''' to '''Allow All'''
     31 - Click '''OK'''
     32
     33==== Adding processors ====
     34 - Select the NetMon VM from left panel on Virtual box, right click and open '''Settings'''
     35 - Click on the '''System''' title
     36 - Go to '''Processor''' tab and set processors to '''2'''
     37 - Click '''ok'''
     38
     39[[Image(https://ws.learn.ac.lk/raw-attachment/wiki/ipv6vmconf/VMSetup.jpg)]]
     40
     41== Create the Additional VMs ==
     42
     43For the next two days of the workshop you will need another linux box. Instead of Installing OS we can clone your VM and create a new VM.
     44You can easily create the second VM using VM cloning. This VM is for your LibreNMS network monitoring system.
     45
     46First Log in to the VM and enter
     47 sudo init 0
     48Right click on the VM to select Clone option
     49Assign new name as LibreNMS
     50Check "Reinitialize the MAC address for all network cards
     51And then click on Continue
     52Select Full clone
     53This might take sometime to create the new virtual disk image (vdi) file. Note that your new VM is same as your previous one. You have to change host name, ip addresses, etc accordingly.
     54
     55=== Setting UP IP Addresses ===
     56
     57==== NetMon VM ====
     58
     59 - Select the '''NetMon''' VM from left panel on Virtual box, right click '''Start''' and wait till the VM starts
     60 - login to the machine using the following user credentials
     61{{{
     62usrname  : learn
     63password : <classpassword>
     64}}}
     65 - Then change the '''interfaces''' file. Root password is the same as class password
     66{{{
     67sudo vi /etc/network/interfaces
     68}}}
     69 - locate the following lines
     70{{{
     71iface enp0s3 inet static
     72 address 192.168.56.2
     73 netmask 255.255.255.0
     74 network 192.168.56.0
     75 broadcast 192.168.56.255
     76 gateway 192.168.56.1
     77 dns-nameservers 192.248.1.161
     78}}}
     79 - Change it to the following lines. You can find your IP Address from this [wiki:2017netmonipallocation table]
     80{{{
     81iface enp0s3 inet static
     82 address <Your IP Address >
     83 netmask 255.255.255.0
     84 network 192.248.6.0
     85 broadcast 192.248.6.255
     86 gateway 192.248.6.254
     87 dns-nameservers 192.248.1.161
     88}}}
     89 - Save and Exit the editor (type ''':wq''')
     90 - When you completed the IP settings , reboot the machine
     91{{{
     92sudo reboot
     93}}}
     94 - Confirm the correct IP settings by '''ifconfig''' command. Your result should be something like the following. Check the IP address of enp0s3 Interface and see whether the other interfaces are up
     95{{{
     96enp0s3    Link encap:Ethernet  HWaddr 08:00:27:8c:e0:26
     97          inet addr:<your IP address>  Bcast:192.248.6.255  Mask:255.255.255.0
     98          inet6 addr: fe80::a00:27ff:fe8c:e026/64 Scope:Link
     99          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     100          RX packets:1120 errors:0 dropped:0 overruns:0 frame:0
     101          TX packets:7550 errors:0 dropped:0 overruns:0 carrier:0
     102          collisions:0 txqueuelen:1000
     103          RX bytes:99387 (99.3 KB)  TX bytes:567441 (567.4 KB)
     104
     105lo        Link encap:Local Loopback
     106          inet addr:127.0.0.1  Mask:255.0.0.0
     107          inet6 addr: ::1/128 Scope:Host
     108          UP LOOPBACK RUNNING  MTU:65536  Metric:1
     109          RX packets:160 errors:0 dropped:0 overruns:0 frame:0
     110          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
     111          collisions:0 txqueuelen:1
     112          RX bytes:11840 (11.8 KB)  TX bytes:11840 (11.8 KB)
     113}}}
     114 - Try ping to some known hosts and see the results.
     115{{{
     116ping 192.248.6.254
     117ping 192.248.1.161
     118ping www.google.com
     119}}}
     120
     121==== LibreNMS VM ====
     122
     123 - Select the '''NetMon''' VM from left panel on Virtual box, right click '''Start''' and wait till the VM starts
     124 - login to the machine using the following user credentials
     125{{{
     126usrname  : learn
     127password : <classpassword>
     128}}}
     129 - Then change the '''interfaces''' file. Root password is the same as class password
     130{{{
     131sudo vi /etc/network/interfaces
     132}}}
     133 - locate the following lines
     134{{{
     135iface enp0s3 inet static
     136 address 192.168.56.2
     137 netmask 255.255.255.0
     138 network 192.168.56.0
     139 broadcast 192.168.56.255
     140 gateway 192.168.56.1
     141 dns-nameservers 192.248.1.161
     142}}}
     143 - Change it to the following lines. You can find your IP Address from this [wiki:2017netmonipallocation table]
     144{{{
     145iface enp0s3 inet static
     146 address <Your IP Address >
     147 netmask 255.255.255.0
     148 network 192.248.6.0
     149 broadcast 192.248.6.255
     150 gateway 192.248.6.254
     151 dns-nameservers 192.248.1.161
     152}}}
     153 - Save and Exit the editor (type ''':wq''')
     154 
     155==== Setting the Hostname and FQDN ====
     156
     157Login to the vm. change to root user
     158{{{
     159$sudo su
     160}}}
     161
     162Give your password
     163
     164Edit /etc/hostname
     165{{{
     166#nano /etc/hostname
     167}}}
     168
     169Change NetMon to LibreNMS
     170Save and Exit
     171also edit /etc/hosts file to change 127.0.0.1 NetMon to 127.0.0.1 LibreNMS
     172
     173When you completed the IP settings , reboot the machine
     174{{{
     175sudo reboot
     176}}}
     177
     178Confirm the correct IP settings by '''ifconfig''' command. Your result should be something like the following. Check the IP address of enp0s3 Interface and see whether the other interfaces are up
     179{{{
     180enp0s3    Link encap:Ethernet  HWaddr 08:00:27:8c:e0:26
     181          inet addr:<your IP address>  Bcast:192.248.6.255  Mask:255.255.255.0
     182          inet6 addr: fe80::a00:27ff:fe8c:e026/64 Scope:Link
     183          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
     184          RX packets:1120 errors:0 dropped:0 overruns:0 frame:0
     185          TX packets:7550 errors:0 dropped:0 overruns:0 carrier:0
     186          collisions:0 txqueuelen:1000
     187          RX bytes:99387 (99.3 KB)  TX bytes:567441 (567.4 KB)
     188
     189lo        Link encap:Local Loopback
     190          inet addr:127.0.0.1  Mask:255.0.0.0
     191          inet6 addr: ::1/128 Scope:Host
     192          UP LOOPBACK RUNNING  MTU:65536  Metric:1
     193          RX packets:160 errors:0 dropped:0 overruns:0 frame:0
     194          TX packets:160 errors:0 dropped:0 overruns:0 carrier:0
     195          collisions:0 txqueuelen:1
     196          RX bytes:11840 (11.8 KB)  TX bytes:11840 (11.8 KB)
     197}}}
     198
     199Try ping to some known hosts and see the results.
     200{{{
     201ping 192.248.6.254
     202ping 192.248.1.161
     203ping www.google.com
     204}}}