Unified Networking Lab – Connecting ESX VM to the Internet

KB ID 0001276

Problem

UPDATE: This is an old article, UNL is now EVE-NG, please use the following link;

EVE-NG Connecting to the Internet

UNL is by far the coolest bit of kit I’ve got my hands on this year. I can run it in ESX, and connect to it from anywhere, so I don’t have to keep my labs on my laptop. But what if you want to connect your labs to a live network? Theres a great article on the unetlab website for the smaller versions of VMWare. If you’re lucky enough to have your own vSphere environment there’s a few more hoops to jump through.

Solution

First job is to present the vNics to the UNL virtual machine. Here all those vNics are in the same ‘port group’, but they don’t have to be, there’s no reason why you can’t present different VLANS,  test networks, or DMZs for example.

ESX VM Network Settings

Here I’m directly on the console, but you can also connect via SSH if you prefer. Make sure you can see the presented vNics with the following command;

ifconfig -a | grep ^eth

Show UNL Ethernet

Those networks need to be ‘bridged’ to the pnet interfaces that you use within UNL, to do that edit the network setttings;

nano /etc/network/interfaces

UNL Edit Internet

Note: I already had nano installed, ‘apt-get install nano’ will install it for you if you don’t. 

Make sure it looks like this, (OK, I’ve got 10 network cards bridged and only presented 5, but I can add more now, without having to go though this process again).

UNL Change Internet Settings

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
iface eth0 inet manual
auto pnet0
iface pnet0 inet dhcp
    bridge_ports eth0
    bridge_stp off
    bridge_ageing 0

# Cloud devices
iface eth1 inet manual
auto pnet1
iface pnet1 inet manual
    bridge_ports eth1
    bridge_stp off
    bridge_ageing 0

iface eth2 inet manual
auto pnet2
iface pnet2 inet manual
    bridge_ports eth2
    bridge_stp off
    bridge_ageing 0

iface eth3 inet manual
auto pnet3
iface pnet3 inet manual
    bridge_ports eth3
    bridge_stp off
    bridge_ageing 0

iface eth4 inet manual
auto pnet4
iface pnet4 inet manual
    bridge_ports eth4
    bridge_stp off
    bridge_ageing 0

iface eth5 inet manual
auto pnet5
iface pnet5 inet manual
    bridge_ports eth5
    bridge_stp off
    bridge_ageing 0

iface eth6 inet manual
auto pnet6
iface pnet6 inet manual
    bridge_ports eth6
    bridge_stp off
    bridge_ageing 0

iface eth7 inet manual
auto pnet7
iface pnet7 inet manual
    bridge_ports eth7
    bridge_stp off
    bridge_ageing 0

iface eth8 inet manual
auto pnet8
iface pnet8 inet manual
    bridge_ports eth8
    bridge_stp off
    bridge_ageing 0

iface eth9 inet manual
auto pnet9
iface pnet9 inet manual
    bridge_ports eth9
    bridge_stp off
    bridge_ageing 0

You can ensure the interfaces are up by running;

brctl show

Show UNL Ethernet Connections

If there’s a problem, you can bring tham up manually by running ‘for i in $(seq 1 9); do ifup pnet${i}; done‘.

ESX Enabling Promiscuous Mode

To enable your devices to talk through your vSwitches, they need to allow ‘promiscuous mode‘, below you can see that being done on the vSwitch (in the VI Client).

Enable Promiscuous ESX

Check the ‘port group’ as well and ensure that will also accept promiscuous mode.

Port Group Promiscuous Mode

If you are using the vSphere Web Client here is where promiscuous mode is set on the vSwitch.

Web Client Enable Promiscuous

And here is where it’s set on the port group.

Web Client Edit vSwitch

Unfortunately you can’t change this setting in the new HTML5 management console but you can view it.

HTML5 VM Client Switch Settings

Connect Your UNL Lab To the Public Network

Add a new node, and select the ‘Network’ option > When you place it you can select which live network you want to connect to.

UNL Add Cloud

WARNING: Connect to live networks as you would in real life, (with a router, firewall, or correctly configured L3 device).

Connect UNL To the Internet

 

Related Articles, References, Credits, or External Links

NA

Author: PeteLong

Share This Post On

5 Comments

    • Great article!!

      I would like some help with the following problem I have:

      I have 10 NIC cards in my VM (esxi6.7) and can choose Cloud0 to Cloud9 in EVE.
      But each time I restart EVE-NG, most of the Clouds are not using the same vmNIC, they often change NIC.

      For example: Cloud1 used to be vmNIC1, but after a reboot of EVE-NG, Cloud1 is vmNIC4.
      I already tried to set a static mac addres in the file: interfaces for each ethernet interface. I also tried to set static mac addresses in vmware (automatic to manual in port groups). Nothing helps and the Clouds keep randomizing NICS…

      Any idea how I can fix this issue?

      Thanks 🙂

      Post a Reply
      • Wow 10 clouds why so many? I don’t know, but I’ll post this here in case some good soul wants to comment!

        P

        Post a Reply
        • Hi Pete,
          Thanks for your reply and posting 🙂

          I use 10 clouds because of a CCIEW lab with physical Access Points and controllers..

          regards,
          Geert

          Post a Reply

Submit a Comment

Your email address will not be published. Required fields are marked *