Last active
August 26, 2021 16:41
-
-
Save shreyakupadhyay/84dc75607ec1078aca3129c8958f3683 to your computer and use it in GitHub Desktop.
Connecting mininet host with Internet.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<-- Commands below connects the mininet hosts to internet and also with other mininet hosts.--> | |
$ sudo mn --topo=single,2 (topology of consisting 1 switch and 2 hosts) | |
$ sudo ifconfig s1 up | |
$ sudo ovs-vsctl add-port s1 enp0s3(or your NAT interface of virtual machine) | |
$ ifconfig enp0s3 0 | |
$ dhclient s1 (To get the IP address for s1. Till here VM will get the internet connectivity through OVS.) | |
mininet> xterm h1 | |
h1> ifconfig h1-eth0 0 | |
h1> dhclient h1-eth0 (This will give the IP address to host h1) | |
h1> exit | |
h2> ifconfig h2-eth0 0 | |
h2> dhclient h2-eth0 (This will give the IP address to host h2. h2 will be in the same network as h1). | |
mininet> h1 ping -c 10 google.com | |
mininet> h1 ping h2 | |
mininet> h2 ping h1 (This will update the rules in OVS.) |
Hey @lowkeyboard, I worked on this long back but still I may be able to help you. enp0s3 is specific to your operating system, instead you can use any other wifi interface which is as per your OS. Let me know if it helps.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
could you help? how can i change and find my port because enp0s3 is not working
"ovs-vsctl: cannot create a port named enp0s3 because a port named enp0s3 already exists on bridge s1"