I am running 5 different Ubuntu distro on wsl2 but all are having the same ip address.For example Ubuntu 18.04 and Ubuntu 20.04 are having the same ip. Is it possible to have different ips on each Ubuntu versions?
I am running 5 different Ubuntu distro on wsl2 but all are having the same ip address.For example Ubuntu 18.04 and Ubuntu 20.04 are having the same ip. Is it possible to have different ips on each Ubuntu versions?
Full disclosure: This answer does not address networking between to wsl2 instances. Rather, it presents - as requested from a commenter - an alternative way to have two guest operating systems to each have their own IP address within a network that is "inside" the host OS.
The following allows for two VMs (rather than wsl2 instances) to have different IP addresses within a network within a host Windows 10 operating system:
+) in it to add a new network
You can create new processes with new network namespaces, so you can achieve network isolation.
ip netns add net1
ip netns exec net1 ip addr add 192.168.99.10/24 dev sit0
ip netns exec net1 exec bash
Reference: https://blogs.igalia.com/dpino/2016/04/10/network-namespaces/