0

First, please take a look at the setup I made using VirtualBox :

switch0 setup dummyserver0 setup the interface name for each adapter is shown below :

  • Adapter 1 = enp0s3
  • Adapter 2 = enp0s8
  • Adapter 3 = enp0s9
  • Adapter 4 = enp0s10

I use that setup, to implement the following diagram :

network diagram

Second, please take a look at the configuration I made for each VM.

Current configuration of the switch0 (UbuntuServer 16.04) VM is :

/etc/sysctl.conf : enable for IPv4 forwarding

net.ipv4.ip_forward=1

/etc/network/interfaces : only for bring up interface and static SSH connection to host machine

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet manual
auto enp0s9
iface enp0s9 inet manual
auto enp0s10
iface enp0s10 inet manual

auto enp0s8
iface enp0s8 inet static
    address 10.0.0.2
    network 10.0.0.0
    broadcast 10.0.0.255
    netmask 255.255.255.0

/etc/rc.local : creating bridge interface, assigning slave interface, and set bridge interface MAC & IP address. MAC Address used for bridge is the device(enp0s3) connected to the Router

#!/bin/sh -e

BRIDGE_IF=br0
UP_IF=enp0s3
DOWN_IF0=enp0s9
DOWN_IF1=enp0s10

ip link add name $BRIDGE_IF type bridge
ip link set dev $BRIDGE_IF up

ip link set dev $UP_IF master $BRIDGE_IF
ip link set dev $UP_IF up

ip link set dev $DOWN_IF0 master $BRIDGE_IF
ip link set dev $DOWN_IF0 up
ip link set dev $DOWN_IF1 master $BRIDGE_IF
ip link set dev $DOWN_IF1 up

UP_MAC=$( cat /sys/class/net/$UP_IF/address )
ip link set dev $BRIDGE_IF address $UP_MAC

ip link set $BRIDGE_IF arp on
ip link set $UP_IF arp on
ip link set $DOWN_IF0 arp on
ip link set $DOWN_IF1 arp on

ip address add 192.168.100.30/24 dev $BRIDGE_IF

exit 0

Current configuration of the dummyserver0 (UbuntuServer 16.04) VM is :

/etc/network/interfaces : set interface for DHCP and static SSH connection to host machine

source /etc/network/interfaces.d/*

auto lo
iface lo inet loopback

auto enp0s3
iface enp0s3 inet dhcp

auto enp0s8
iface enp0s8 inet static
    address 10.0.0.3
    network 10.0.0.0
    broadcast 10.0.0.255
    netmask 255.255.255.0

Now, using all of the above configuration here's what I get :

  • switch0 is able to PING to Router but not to dummyserver0
  • dummyserver0 is able to obtain DHCP IP but cannot PING to anywhere

if I change the br0 MAC Address in switch0 to enp0s9's MAC Address (which is used to connect switch0 to dummyserver0), here's what I get :

  • switch0 and dummyserver0 is able to PING each other
  • switch0 cannot PING to Router
  • dummyserver0 is able to obtain DHCP IP but cannot PING to Router

Why is this happening? Any help would be greatly appreciated. Thanks.

  • if "Adapter 1 = enp0s3" is a wireless interface (according to the screenshot) and not ethernet, expect trouble when it's used in a bridge. that's related to having to switch it to 4-mac-addresses mode instead of 3-mac-adresses mode ( networkengineering.stackexchange.com/questions/25100/…) and requires also support on the AP – A.B May 8 '18 at 13:28
  • @A.B yes, if that is the problem, please wait, I will try to change it to another type and see if the problem persist. – Rizky K. May 8 '18 at 13:37
  • I don't know if it's related or not (I admit I didn't get all of the settings). I'm just saying that one should always use only ethernet with a bridge first, before experimenting with wireless in it – A.B May 8 '18 at 13:44
  • also (still as a comment) you can use network namespaces to implement your switch instead of a VM, it's often more simple, if you know all the low level commands (including those "moving" the physical network cards). look there linux-blog.anracom.com/2017/10/30/… , linux-blog.anracom.com/2017/11/14/… – A.B May 8 '18 at 13:54
  • @A.B hello, I have try to change the enp0s3 interface on switch0 to use VBox Host-Only Adapter and the problem still exactly the same. The difference here is, on switch0 IP setting I use DHCP, and for some unknown reason 2 interface (enp0s3 and br0) get different IP, shouldn't it be only br0 who get the addresses? – Rizky K. May 8 '18 at 13:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.