Bridged Networking / Virtual NIC
Last updated
Last updated
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.
Ethernet port | Bridge name | Interface name | Speed |
Port 0 | br0 | enp0s20f0 | 10M/100M/1G |
Port 1 | br1 | enp0s20f1 | 10M/100M/1G |
Port 2 | br2 | enp0s20f2 | 10M/100M/1G |
Port 3 | br3 | enp0s20f3 | 10M/100M/1G |
Ethernet Port | Bridge name | Interface name | Speed |
---|---|---|---|
Port 0 | br0 | eno1 | 10M/100M/1G |
Port 1 | br1 | eno2 | 10M/100M/1G |
Port 2 | br2 | eno3 | 10M/100M/1G |
Port 3 | br3 | eno4 | 10M/100M/1G |
Ethernet port | Bridge name | Interface name | Speed |
Port 0 | br0 | eno1 | 10M/100M/1G |
Port 1 | br1 | eno2 | 10M/100M/1G |
Port 2 | br2 | eno3 | 1G/10G |
Port 3 | br3 | eno4 | 1G/10G |
Ethernet port | Bridge name | Interface name | Speed |
Port 0 | br0 | eno3 | 1G/10G |
Port 1 | br1 | eno4 | 1G/10G |
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.
Navigate to the 'Network' page on antMan.
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.
Note: 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 - br0. Your antlets and the Antsle can co-exist on this ethernet port. You can think of br0, br1... as internal switches that you can connect multiple antlets to in order to share the same physical port.
Important: Heed the DHCP warning about having a wired connection!
Restart the Antsle and confirm the settings are good when it comes back up. If you cannot access antman after reboot, the Antsle will revert back to the last working configuration in {minutes}.
Click on the antlet name in antman.
Click 'New virtual NIC'
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. Any flavor of Linux should support VirtIO.
Now you have an additional Virtual NIC attached to this antlet and exposed to the network of the physical ethernet port.
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.
Antsle is designed to multiplex all your virtual servers under a single public IP address. If you have the luxury of having multiple static public IP addresses from your ISP then you can connect an antlet directly to one of those addresses.
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 assign 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
After adding an additional network interface to an antlet you will need to configure the IP address in the operating system of that antlet.
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
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:
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.
Edit configuration file
Debian and Ubuntu 16.04: Open the configuration file for editing with your preferred editor. Nano, Vi... For Ubuntu 16.04 KVM or ubuntu-xenial LXC
To configure DHCP, add the following to the top of the configuration file
For a Static IP address, add the following to the top of the configuration file Adjust the addresses to your needs
Restart network service
Ubuntu 18.04 uses 'netplan' by default. Open the netplan .yaml configuration file with your preferred editor - Nano, Vi... For Ubuntu 18.04 KVM or LXC
To configure DHCP, add the interface (eth1 in this example) and enable 'dhcp' for the interface Here we are adding the 'eth1:' section
For a Static IP address, the interface section would look like this
Be sure to use consistent indentation in the .yaml files Apply the changes with
Adjust the addresses to your needs I used the interface name 'eth1' in these examples but yours may be different. Yaml does allow items to use different syntax, e.g. 'lists' can use [192.168.1.1, 8.8.8.8].
You can verify your changes by listing the interfaces again
.
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
After enabling the new virtual NIC, ssh with the -p option may no longer work, but now you have direct access via the new IP address assigned to the virtual NIC.
Get the interface name of the new Bridged NIC
To list the interfaces run:
Your new NIC will most likely be called eth1
. Interface eth0
should have the Antsle's internal 10.1.1.x address and the new bridged interface, eth1
, may or may not have acquired an address from DHCP.
Configuration file
In CentOS 7 the interface configuration file will be stored in
Each NIC will have its own configuration file. These files are named ifcfg-NIC_NAME
You can list the configuration files with ls -1 /etc/sysconfig/network-scripts/ifcfg-*
Currently there is no configuration file for eth1. Open the configuration file in your favorite editor. If the file does not exist this command will create it.
Configure static IP address
Edit the DEVICE, IPADDR, PREFIX, GATEWAY, and DNS1
DEVICE is the interface name, eth1
IPADDR is the static address you want to assign to this NIC
PREFIX is the subnet mask number of bits (255.255.255.0 is 24 bits)
GATEWAY is the gateway for this subnet
DNS1 is your DNS server address
DEFROUTE tells the system if you want this Gateway to be the default route. Set this to "no" in the configuration files for other interfaces
Restart network serverce
To configure IP address setting on Windows, Open Control Panel Click Network and Internet link
Click Network and Sharing Center
Click Change Adapter Settings in the left column
Rt Click the new adapter and choose Properties at the bottom of the context menu
Choose Internet Protocol Version 4 (TCP/IPv4) from the center pane. Click the Properties button.
Configure to your needs.