-1

I'm using OpenStack to help me virtualize my infrastructure. You can see how my topology looks like --> My Topology in Openstack

I face issues in configuring the 2 switches. Here is what I have done (I'm in sudo mode) :

1) Installing openvswitch paquets :

apt-get install openvswitch-switch

2) Creating a bridge named br0 :

ovs-vsctl add-br br0

3) Turn up mybridge interface :

ifconfig br0 up

4) Add the physical interface ens4 to the bridge (I'm connecting through the switch via SSH using the interface ens3) :

ovs-vsctl add-port br0 ens4

5) Remove ens4's IP addressing :

ifconfig ens4 0

6) Add to br0 the former ens4's IP adressing (I take the switch 1 for instance) :

ifconfig br0 192.168.1.18 

7) Add a default gateway in the routing table :

route add default gw 192.168.1.1 br0

Unfortunately, after all those steps, I'm still unable to ping from Host_1 (whose IP address is 192.168.1.12) to my Switch_1 (whose IP address is 192.168.1.18, the IP address 192.168.0.30 is used for configuring the Switch via SSH connection) and vice-versa.

Any ideas ? Thank you in advance

P.S. : If the image is not readable, please tell me, I'll make a new one.

1 Answers1

1

I'm assuming those switches represent VMs, basically because in OpenStack you can't create switches.

That being said, due to ARP reasons, you have to change the MAC addresses. Try giving the bridge the same MAC address as ens4 and change the MAC address of ens4. The script should look like this:

NIC="ens4"
MAC=$(ifconfig $NIC | grep "HWaddr\b" | awk '{print $5}')  
ovs-vsctl add-br br0 -- set bridge br0 other-config:hwaddr=$MAC
ovs-vsctl add-port br0 $NIC > /dev/null 2>&1
ifconfig $NIC 0.0.0.0
LAST_MAC_CHAR=${MAC:(-1)}
AUX="${MAC:0:${#MAC}-1}"
if [ "$LAST_MAC_CHAR" -eq "$LAST_MAC_CHAR" ] 2>/dev/null; then
    NL="a"
else
    NL="1"
fi
NEW_MAC="$AUX$NL"
ifconfig $NIC hw ether $NEW_MAC

Also, check you allow ICMP traffic in the security groups of the VMs.

Albert V.
  • 9
  • 2