On 2/18/23 09:22, Bilinmek Istemiyor via discuss wrote:
Hello,
I am looking for a solution to create several virtual switches
connected by a virtual router on a single linux pc. I would like to
create a test, development or similar environments which has its own
ip address space and use a single linux pc along with already
available kvm/qemu/libvirt capability for the virtual machines or
containers.
look at lxc/lxd - a linux kernel native namespace/process management
solution
I have understood that openvswitch can create virtual switches as the
name suggests, but I have not been able to find any instructions
related to creating a virtual router. I have seen some posts routing
the these switches' traffic with kernels network configuration, but I
am more looking for virtual switches/routers and their virtual
interfaces without messing my host routing settings often and manually.
you'll want to dive into the world of iproute2 - it is a series of tools
for managing namespaces, interfaces, addressing, routing, tunnels, ....
I will connect my custom build kvm/qemu containers or virtual machines
to these enviroments. I have previously used vagrant, docker, proxmox
but I do not want to use those tools since they have their specific
attachments.
as mentioned earlier, iproute2 namespaces are dead simple, or use
lxc/lxd for something a bit more segregated
My internet searches pointed me, open virtual networking (ovn) which
claims to do virtual switches, routers etc and seems to be using
openvswitch underneath. However ovn seems like it requires higher
level of tooling or services such as openstack provides etc. I have
not seen a proper package for that in arch linux as well which I am
currently using.
To make long story short:
*
Can I create several private network switches for such as
192.168.100.0/24 <http://192.168.100.0/24>, 192.168.101.0/24
<http://192.168.101.0/24>, 192.168.102.0/24
<http://192.168.102.0/24> for host, test, development etc. and
connect them to a virtual router and make these machines
accessible from my lan via *openvswitch* in a reqular linux box.
*
If not, which toolset I can use to achive that. I am only
interested in the networking stack, and I would like to be free
of any other stack or technology such as openstack, proxmox,
vagrant or docker which came as bundled with their services, image
types etc.
Your overall tooling would be comprised of (in increasing order of
complexity and abstraction):
* iproute2 (ip ns, ip link, ip addr, ip route, ....) - native kernel
network management
o the trick is to use veth interfaces to link namespaced
environments via the ip ns command
* ifupdown or ifupdown2 - persisting network configurations across
sessions
* open vswitch and/or bridge - kernel switching solutions
* mininet - a python tool for quickly building virtual networks on
your pc (a high level tool using iproute2 functionality (ip ns,
veth, etc))
* frr - free range routing - actual routing protocols for advanced
routing development
Hope this helps on your networking journey
Raymond Burkholder
https://blog.raymond.burkholder.net/index.php?/categories/67-Networks
_______________________________________________
discuss mailing list
disc...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-discuss