Bridged Networking / Virtual NIC

Introduction

Bridged networking allows you to attach an additional virtual network interface to an antlet. This virtual NIC will connect to one of the physical ethernet ports on the rear of the antsle by way of an internal bridge. Then the antlet can be accessed directly on the local LAN.

antsle one, antsle one Pro, antsle one Ultra

antsle one ethernet port numbers
Ethernet portBridge nameInterface nameSpeed
Port 0br0enp0s20f010M/100M/1G
Port 1br1enp0s20f110M/100M/1G
Port 2br2enp0s20f210M/100M/1G
Port 3br3enp0s20f310M/100M/1G



antsle one XD, antsle one XD Pro, antsle one XD Ultra

antsle one XD ethernet port numbers
Ethernet portBridge nameInterface nameSpeed
Port 0br0eno110M/100M/1G
Port 1br1eno210M/100M/1G
Port 2br2eno31G/10G
Port 3br3eno41G/10G



antsle one XD

antsle one XD ethernet port numbers
Ethernet portBridge nameInterface nameSpeed
Port 0br0eno31G/10G
Port 1br1eno41G/10G

Enable bridging

Ethernet port 0 is enabled for bridging by default. You can connect your antlets to this bridge port by configuring a 'Virtual NIC' in the antlet details page (discussed later) - with no additional configuration here.
In antmans home page, under the Private IP address, click 'Show all NICs'

Click Show all nics
Click Show all nics

br0 is enabled by default and is your access to antman and to your antlets on the 10.1.1.x network. You should leave this enabled and connected to the LAN.

Enabling an additional port is not necessary if you want your antlets bridged to the same local network as br0. When you configure a virtual NIC on an antlet you can choose this same port. Your antlets and the antsle can co-exist on this ethernet port.

Here you can also see the IP address aquired from DHCP on the local LAN.

Enable another interface by checking its checkbox.

enable br1

Click the 'Edit' button to configure DHCP or set a static address.

Configure dhcp or static ip form
Important: Heed the DHCP warning about having a wired connection!

Restart the antsle

Restart the antsle and confirm the settings are good when it comes back up.

Restart message
If you cannot access antman after reboot, the antsle will revert back to the last working configuration in {minutes}.


Configure Virtual NIC

Enter the antlet details page

Click on the antlet name in antman.

antlet list

Choose the 'Virtual Network' tab

Click 'New virtual NIC'
Virtual NICs tab

Choose a bridge/ethernet port

You can have multiple antlets on the same physical port. In this example I will leave it on br0.
The 'Model' should be 'e1000' for Windows antlets or if the OS does not have virtio drivers.
Virtual NICs form

Click 'Create virtual NIC'

Now you have an additional Virtual NIC attached to this antlet and exposed to the network of the physical ethernet port.
Virtual NICs list

Stop and Start the antlet.

Start antlet
Check the operating system of the antlet to configure the new NIC.
See Configure IP address to learn how to configure IP addresses for different operating systems.


Connect antlet directly to public internet

If you have multiple static IP addresses from your ISP then you can connect an antlet directly to the public internet.

First connect the antsle to the the public interface provided by your ISP. This could be the modem or a router port configured for 'bridge' mode.

Then create a virtual NIC in your antlet as explained above and assigned it to the same interface that is connected to the public internet.

Configure the IP address in the antlet as described below. Be sure and configure the correct subnet mask and gateway address.

Here is an example for Debian/Ubuntu. Be sure to place the configuration for eth1, the virtual NIC, before eth0 in the configuration file

Adjust the addresses to your needs

auto eth1
iface eth1 inet static
 address 70.168.1.105
 netmask 255.255.255.240
 gateway 70.168.1.1

auto eth0
iface eth0 inet dhcp

Configure IP Address

After adding an additional network interface to an antlet you will need to configure the IP address in the operating system of that antlet.

Debian/Ubuntu

Connect to the antlet via ssh

In this case it is best to ssh to the antlet from within antsleOS. See Log in to your antlets

ssh myantsle.local
ssh 10.1.1.x

After enabling the new virtual NIC, ssh with the -p option no longer works but now you have direct access via the new IP address assigned to the virtual NIC.

Get the interface name

To list the interfaces run:

ip addr

Your new NIC will most likely be called eth1@if36. We only need the eth1 part.
eth0 should have the antsle's internal 10.1.1.x address.

output of ip addr command

Edit configuration file

The location of the configuration file is:

/etc/network/interfaces

Edit this file with your preferred editor. Nano, Vi...

nano /etc/network/interfaces

For DHCP, add the following to the top of the configuration file

auto eth1
iface eth1 inet dhcp

For a Static IP address, add the following to the top of the configuration file
Adjust the addresses to your needs

auto eth1
iface eth1 inet static
 address 192.168.1.105
 netmask 255.255.255.0
 gateway 192.168.1.1
 dns-nameservers 192.168.1.1

Restart network service

ifup eth1

You can then verify your changes by listing the interfaces again

ip addr

.


CentOS

NOTE: For CentOS-7.1 LXC, install Network Manager... yum install NetworkManager (case sensitive)

Connect to the antlet via ssh

In this case it is best to ssh to the antlet from within antsleOS. See Log in to your antlets

ssh myantsle.local
ssh 10.1.1.x

After enabling the new virtual NIC, ssh with the -p option no longer works but now you have direct access via the new IP address assigned to the virtual NIC.

Get the interface name and MAC address

To list the interfaces run:

ip addr

Your new NIC will most likely be called eth1.
eth0 should have the antsle's internal 10.1.1.x address.

The MAC address is on the line that starts with link/ether Copy this address for use in the configuration file.

output of ip addr command showing NIC name and MAC

Configuration file

In CentOS the NIC configuration file will be stored in

/etc/sysconfig/network-scripts/

Each NIC will have its own configuration file. These files are named ifcfg-NIC_NAME
You can list the configuration files with

ls -l /etc/sysconfig/network-scripts/ifcfg-*
output of ip addr command

Currently there is no configuration file for eth1. Don't worry, we will create it later.

Next, generate a uuid for the NIC

uuidgen eth1
output of ip addr command

Copy the uuid generated from this command for use in the configuration file.

Open the configuration file in your favorite editor. If the file does not exist this command will create it.

nano /etc/sysconfig/network-scripts/ifcfg-eth1

Configure static IP address
Edit the NAME, UUID, HWADDR, IPADDR0, PREFIX0, GATEWAY0, and DNS1
NAME is the interface name, eth1
UUID is the generated output of uuidgen eth1
HWADDR is the MAC addres from the output of ip addr
IPADDR0 is the static address you want to assign to this NIC
PREFIX0 is the subnet mask number of bits (255.255.255.0 is 24 bits)
GATEWAY0 is the gateway for this subnet
DNS1 is your DNS server address

TYPE="Ethernet"
BOOTPROTO="none"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
NAME="eth1"
UUID="2efb5000-f491-46ad-96e3-12527942e70a"
ONBOOT="yes"
HWADDR="52:54:00:e1:5a:21"
IPADDR0="192.168.0.227"
PREFIX0="24"
GATEWAY0="192.168.0.1"
DNS1="8.8.8.8"
IPV6_PEERDNS="yes"
IPV6_PEERROUTES="yes"
output of ip addr command

Restart network serverce

systemctl restart network
restart network service

Windows

To configure IP address setting on Windows, Open Control Panel
Click Network and Internet link

Control Panel Network and Internet

Click Network and Sharing Center

Control Panel Network and Sharing Center

Click Change Adapter Settings in the left column

Control Panel change adapter settings

Rt Click the new adapter and choose Properties at the bottom of the context menu

Right click NIC

Choose Internet Protocol Version 4 (TCP/IPv4) from the center pane.
Click the Properties button.

Choose IPv4 properties

Configure to your needs.

configure ip properties