# Need the procedure for changing Microk8s Flannel from 'vxlan' to 'host-gw'

**URL:** <https://discuss.kubernetes.io/t/need-the-procedure-for-changing-microk8s-flannel-from-vxlan-to-host-gw/13252>\
**Category:** microk8s\
**Created:** [October 14, 2020, 10:29am UTC](https://discuss.kubernetes.io/t/need-the-procedure-for-changing-microk8s-flannel-from-vxlan-to-host-gw/13252 "2020-10-14T10:29:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stevetee](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@stevetee](https://discuss.kubernetes.io/u/stevetee)\
**Post date:** [October 14, 2020, 10:29am UTC](https://discuss.kubernetes.io/t/need-the-procedure-for-changing-microk8s-flannel-from-vxlan-to-host-gw/13252/1 "2020-10-14T10:29:17Z")

</div>

I am working on an on-premise implementation of Microk8s. By default, Microk8s Flannel is configured to communicate using a vxlan overlay network. This won’t work for our environment and is preventing us from creating a fully-functional cluster. I am trying to change this to ‘host-gw’.

I have been unable to find any documentation or forum entries that explain how to make this change. I have found the file /var/snap/microk8s/current/args/flannel-network-mgr-config. However, this file appears to be an output of the configuration process not the place where the configuration change is actually made.

Any advice would be appreciated.

---

<div class="post-metadata">

**Author:** ![balchua1](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.kubernetes.io/balchua1/32/5372_2.png) [@balchua1](https://discuss.kubernetes.io/u/balchua1)\
**Post date:** [October 14, 2020, 12:20pm UTC](https://discuss.kubernetes.io/t/need-the-procedure-for-changing-microk8s-flannel-from-vxlan-to-host-gw/13252/2 "2020-10-14T12:20:06Z")

</div>

Fyi. I have not tried this at all.

I think you can use etcdctl. As an example in microk8s `${SNAP}/etcdctl" --endpoint "${etcd_endpoints}" --cert-file "${cert_file}" --key-file "${key_file}" --ca-file "${ca_file}" set "/coreos.com/network/config" "$data"`

Where `$data` is the content of the file `/var/snap/microk8s/current/args/flannel-network-mgr-config`

Stop flanneld using `systemctl` run the etcdctl like above. Set the record in etcd then start etcd.

Check this out. [https://github.com/ubuntu/microk8s/blob/2db20fdfdbf122185726fb196ac5df9a405143f3/microk8s-resources/wrappers/run-flanneld-with-args#L44](https://github.com/ubuntu/microk8s/blob/2db20fdfdbf122185726fb196ac5df9a405143f3/microk8s-resources/wrappers/run-flanneld-with-args#L44)

---

<div class="post-metadata">

**Author:** ![stevetee](https://avatars.discourse-cdn.com/v4/letter/s/59ef9b/32.png) [@stevetee](https://discuss.kubernetes.io/u/stevetee)\
**Post date:** [November 30, 2020, 2:21pm UTC](https://discuss.kubernetes.io/t/need-the-procedure-for-changing-microk8s-flannel-from-vxlan-to-host-gw/13252/3 "2020-11-30T14:21:48Z")

</div>

Using etcdctl did not work. I was able to make the change simply be editing the configuration file /var/snap/microk8s/current/args/flannel-network-mgr-config to contain ‘{“Network”: “10.1.0.0/16”, “Backend”: {“Type”: “host-gw”}}’. I had to do this on all nodes of the cluster.
