# create a topology with a switch(s1) and a host(h1)
$ sudo mn --topo single,1
# add a port on s1, set the type to vxlan
$mininet > sh ovs-vsctl add-port s1 vxlan -- set interface vxlan type=vxlan option:remote_ip=192.168.7.3 option:key=100
# create a topology with a switch(s1) and a host(h1)
$ sudo mn --topo single,1
# add a port on s1, set the type as vxlan
$mininet > sh ovs-vsctl add-port s1 vxlan -- set interface vxlan type=vxlan option:remote_ip=192.168.56.101 option:key=100
# set h1's ip address to 10.0.0.2
$mininet > h1 ifconfig h1-eth0 10.0.0.2
from mininet.topo import Topo
class MyTopo( Topo ):
def __init__( self ):
Topo.__init__( self )
# Add switches
s1 = self.addSwitch( 's1' )
s2 = self.addSwitch( 's2' )
# Add links
self.addLink( s1, s2 )
topos = { 'mytopo': MyTopo }
$ sudo mn --custom topo.py --topo mytopo
# bind ethernet interfaces on ovs bridges
$ sudo ovs-vsctl add-port s1 enp0s3
$ sudo ovs-vsctl add-port s2 enp0s8
# allocate ip addresses for ovs bridges
$ sudo dhclient enp0s3
$ sudo dhclient enp0s8
# add flow rules on s1
$ sudo ovs-ofctl add-flow s1 'priority=50000,udp,nw_dst=192.168.7.3,actions=output:1'
$ sudo ovs-ofctl add-flow s1 'priority=50000,udp,nw_dst=192.168.56.101,actions=output:2,mod_dl_src:08:00:27:c4:d9:6f,mod_dl_dst:08:00:27:91:1b:a1'
# add flow rules on s2
$ sudo ovs-ofctl add-flow s2 'priority=50000,udp,nw_dst=192.168.56.101,actions=output:1'
$ sudo ovs-ofctl add-flow s2 'priority=50000,udp,nw_dst=192.168.7.3,actions=output:2,mod_dl_src:08:00:27:10:6b:6c,mod_dl_dst:ff:ff:ff:ff:ff:ff'
or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Do you want to remove this version name and description?
Syncing