[ovs-discuss] Openvswitch with LXC

George Papathanail papathanail24 at gmail.com
Thu Feb 4 07:41:27 UTC 2021


Thank you Rayomond,

I followed these steps:

1) sudo lxc-start -n c2 -d --logfile=logs
2) ovs-vsctl add-br switch0
ip add add 192.168.100.1/24 dev switch0

I have these two scripts:
BRIDGE=switch0 ovs-vsctl --may-exist add-br $BRIDGE ovs-vsctl --if-exists
del-port $BRIDGE $5 ovs-vsctl --may-exist add-port $BRIDGE $5

# cat /etc/lxc/ifdown #!/bin/bash ovsBr=switch0 ovs-vsctl --if-exists
del-port ${ovsBr} $5


I managed to attach the lxc interface to the ovs-bridge
sudo ovs-vsctl show
8cd3e1a6-eaa9-4341-b5c8-677e381c8306 Bridge switch0 Port vethlQXvGc
Interface vethlQXvGc Port switch0 Interface switch0 type: internal
ovs_version: "2.13.1"
The problem now is that the container did not take IP. P.S I only have one
physical interface so I did not bind it with the bridge.



Στις Πέμ, 4 Φεβ 2021 στις 8:28 π.μ., ο/η Raymond Burkholder <
ray at oneunified.net> έγραψε:

> Pretty simple:
>
> 1) read the man page on lxc.container.conf
> 2) build one or two interface up/down files
>
> Don't guarantee this works without a bit of extra massaging, but should be
> enough to get started:
>
> # cat /etc/lxc/scripts/ovs.port.up.sh
> #!/bin/bash
> logger "lxc_name=${LXC_NAME}"
> logger "lxc_config=${LXC_CONFIG_FILE}"
> logger "values = $1 $2 $3 $4 $5"
> logger "vlan=${VLAN} $5"
> BRIDGE=ovsbr0
> ovs-vsctl --may-exist add-br $BRIDGE
> ovs-vsctl --may-exist add-port $BRIDGE $5
> if [ "$VLAN" != "" ]; then
>   ovs-vsctl set port $5 tag=$VLAN
>   fi
>
>
> There might be other tidbits at:
> https://blog.raymond.burkholder.net/index.php?/categories/7-LXC
>
>
> On 2/3/21 10:12 AM, George Papathanail wrote:
>
> Hello everyone, I'm trying to connect LXC with Openvswitch and to have a
> setup like this:
>
>
>
> I'm kindly asking for your input, or if there is a tutorial please let me
> know
>
> Thank you in advance
>
> _______________________________________________
> discuss mailing listdiscuss at openvswitch.orghttps://mail.openvswitch.org/mailman/listinfo/ovs-discuss
>
>
> _______________________________________________
> discuss mailing list
> discuss at openvswitch.org
> https://mail.openvswitch.org/mailman/listinfo/ovs-discuss
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openvswitch.org/pipermail/ovs-discuss/attachments/20210204/77529185/attachment-0001.html>


More information about the discuss mailing list