---
# System prepended metadata

title: ERSPANシンプル環境テスト(options)

---

# ERSPANシンプル環境テスト(options)

## options:keyを変更するとsession idが変化するか

options:key=1からoptions:key=2に変更

```
<host01>

bridge="br-int"
erspan_port="at_erspan0"
erspan_port_tag="111"
nic_port="eth1"
bridge_port_ip="192.168.50.1"
bridge_port_mask="24"
erspan_remote_ip="192.168.50.2"
dump_port="dumpport"
dump_port_tag="2"
vm_port_tag="3"

bridge_port_ip_mask="${bridge_port_ip}/${bridge_port_mask}"

# make erspan tunnel
ovs-vsctl add-port ${bridge} ${erspan_port} tag=${erspan_port_tag} -- \
  set Interface ${erspan_port} type=erspan \
  options:key=2 options:remote_ip=${erspan_remote_ip} \
  options:erspan_ver=2 options:erspan_dir=1 \
  options:erspan_hwid=4  

# make mirror
ovs-vsctl -- \
  --id=@p get port ${erspan_port} -- \
  --id=@m create mirror name=mirror_vlan select-all=true select-vlan=${vm_port_tag} output-port=@p -- \
  set bridge ${bridge} mirrors=@m

<del>
ovs-vsctl clear bridge ${bridge} mirrors
ovs-vsctl del-port ${bridge} ${erspan_port}
ovs-vsctl list mirror
ovs-vsctl show
rmmod ip_gre
rmmod ip_tunnel
rmmod gre
lsmod | grep gre

<show>
ovs-vsctl list mirror
ovs-vsctl show

```

ovs-vsctl show
before/after：
```
before:
        Port at_erspan0
            tag: 111
            Interface at_erspan0
                type: erspan
                options: {erspan_dir="1", erspan_hwid="4", erspan_ver="2", key="1", remote_ip="192.168.50.2"}

↓

after:
        Port at_erspan0
            tag: 111
            Interface at_erspan0
                type: erspan
                options: {erspan_dir="1", erspan_hwid="4", erspan_ver="2", key="2", remote_ip="192.168.50.2"}
```

options:keyを2に変更すると、session id(span id)が2に変化した。
![](https://i.imgur.com/7kH4zqZ.png)

