0

i have installed openvswitch-2.3.2 in Amazon EC2 CentOS 6.5, and want to use openvswitch to build a gre tunnel with other PCs.

this is the ifconfig output

[root@ip-172-31-30-157 openvswitch]# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 9001
inet 172.31.30.157  netmask 255.255.240.0  broadcast 172.31.31.255
inet6 fe80::47b:d1ff:fe65:5a6d  prefixlen 64  scopeid 0x20<link>
ether 06:7b:d1:65:5a:6d  txqueuelen 1000  (Ethernet)
RX packets 573591  bytes 200865634 (191.5 MiB)
RX errors 0  dropped 0  overruns 0  frame 0
TX packets 496014  bytes 101375588 (96.6 MiB)
TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

and route output

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         ip-172-31-16-1. 0.0.0.0         UG    100    0        0 eth0
172.31.16.0     0.0.0.0         255.255.240.0   U     0      0        0 eth0
172.31.16.0     0.0.0.0         255.255.240.0   U     100    0        0 eth0

and i use the following commands

ovs-vsctl add-br OVS-SWITCH
ovs-vsctl add-port OVS-SWITCH eth0
ifconfig eth0 0
ifconfig OVS-SWITCH 172.31.30.157 netmask 255.255.240.0
route add default gw 172.31.16.1 dev OVS-SWITCH

but after i execute these commands, i lose the connection with my ec2.

the commands work fine in VM at our lab, but do not work in Amazon EC2.

does anyone have deployed openvswitch in amazon ec2, and could you please give me some suggestions.

many thanks.

1 Answer 1

2

One of the best practices we have is when you want an interface to have an IP and to be bridged somewhere (no matter OVS or brctl), you want to have the bridge interface to have the IP (like br0 or br-ex or OVS-SWITCH in your example), not the interface (eth0). You may want to reconfigure your ifcfg scripts.

I have encountered an issue recently on Centos 7. If you configure a bridge and an interface in ifcfg scripts, the bridge gets the MAC from the interface, rendering ifup/ifdown scripts buggy, as they expect that a MAC defines a device (see ip -o link). I added these lines to my bridge ifcfg:

HWADDR=96:06:81:10:d0:43
OVS_EXTRA="set Bridge $DEVICE other-config:hwaddr=$HWADDR"

In your case it may be $NAME, not $DEVICE.

Look here for the ifcfg options 1

1
  • did you configure ovs in amazon ec2?i will try what you suggest. i wonder why the commands i used does not work in amazon ec2 but works in my local PC
    – zhaojun12
    Jul 10, 2015 at 4:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .