Configuring OVS on TP-LINK Archer C7 v5

Hello everyone!

Currently, I'm trying to make my Openwrt (version 19.07.8) router (TP-LINK Archer C7 v5) a controllable SDN switch. I have flashed my router with OpenWrt (19.07.8) and installed OVS with opkg update then opkg install openvswitch. Right now I'm just trying to configure my router so that it can still act like a normal router with or without a controller connected. Below is my current config (ovs-br is the OVS bridge that I have created):

My physical routers set up:

ISP --> (DSL)Router1(LAN) --> (WAN)Router2(LAN) --> (WAN)OpenWrt_OVS_Router(LAN) --> Windows_PC
$ ifconfig ovs-br up
$ ifconfig
br-lan    Link encap:Ethernet  HWaddr 28:EE:52:62:DB:9D
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd24:ca6a:2266::1/60 Scope:Global
          inet6 addr: fe80::2aee:52ff:fe62:db9d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:50846 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58541 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11235102 (10.7 MiB)  TX bytes:35872392 (34.2 MiB)

eth0      Link encap:Ethernet  HWaddr 28:EE:52:62:DB:9D
          inet6 addr: fe80::2aee:52ff:fe62:db9d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:116016 errors:0 dropped:0 overruns:0 frame:0
          TX packets:108701 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:52277299 (49.8 MiB)  TX bytes:47889499 (45.6 MiB)
          Interrupt:4

eth0.1    Link encap:Ethernet  HWaddr 28:EE:52:62:DB:9D
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:50847 errors:0 dropped:0 overruns:0 frame:0
          TX packets:58541 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:11235148 (10.7 MiB)  TX bytes:35872392 (34.2 MiB)

eth0.2    Link encap:Ethernet  HWaddr 28:EE:52:62:DB:9E
          inet addr:192.168.3.25  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::2aee:52ff:fe62:db9e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:65116 errors:0 dropped:0 overruns:0 frame:0
          TX packets:50134 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:38941943 (37.1 MiB)  TX bytes:11579792 (11.0 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:244 errors:0 dropped:0 overruns:0 frame:0
          TX packets:244 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:23587 (23.0 KiB)  TX bytes:23587 (23.0 KiB)

ovs-br    Link encap:Ethernet  HWaddr 62:A1:3F:9B:4E:4D
          inet6 addr: fe80::60a1:3fff:fe9b:4e4d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:746 (746.0 B)

wlan0     Link encap:Ethernet  HWaddr 28:EE:52:62:DB:9C
          inet6 addr: fe80::2aee:52ff:fe62:db9c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:876 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:132233 (129.1 KiB)
$ ovs-vsctl show
d4a99c27-a9ad-4d57-ac81-f83d92e4aaf1
    Bridge ovs-br
        Port ovs-br
            Interface ovs-br
                type: internal
    ovs_version: "2.11.6"

As this is the first time for me to do something like this, I've got many issues when I was configuring the interfaces and ports for my OVS bridge. I have tried to add eth0.2 which is the WAN interface to ovs-br and flashed its IP address then add it to ovs-br, after this I have made my ovs-br as the default route.

$ ovs-vsctl show
d4a99c27-a9ad-4d57-ac81-f83d92e4aaf1
    Bridge ovs-br
        Controller "tcp:controller_ip:6633"
        Port ovs-br
            Interface ovs-br
                type: internal
        Port "eth0.2"
            Interface "eth0.2"
    ovs_version: "2.11.6"
$ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.3.1     0.0.0.0         UG    0      0        0 ovs-br
192.168.3.0     0.0.0.0         255.255.255.0   U     0      0        0 ovs-br
192.168.111.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0.1

However, as soon as I added br-lan which is the bridged LAN interface to my ovs-br, I lose connection or access to my router (both ssh and Luci web interface).

Any suggestions on how should I approach this issue? I just want to get the OVS bridge set up successfully (with both LAN and WAN interface connected to the bridge) at the same time I can access the internet like normal.

Much appreciated!

I have the same issue, did you solve it ?
if yes, please show me your script and what you did !

Regards.