Hi!
Thank you so much for confirming this for me! I l would love to have a look at your VLAN configs if you still have them and you are fine sharing them with me
My goal is actually exactly the same as you, just aiming only at maintaining internet connectivity while using OVS. However, I'm currently using TP-LINK Archer C7 v5 instead of your v2, and running similar commands didn't really work on my machine. Below is v5's ifconfig, basically when comparing to v2, the WAN interface has changed from eth0
to eth0.2
, the LAN interface has changed from eth1
to eth0.1
.
$ 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:56688095 errors:0 dropped:0 overruns:0 frame:0
TX packets:107523935 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5055776575 (4.7 GiB) TX bytes:149122794794 (138.8 GiB)
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:164488040 errors:0 dropped:0 overruns:3 frame:0
TX packets:164146639 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1043657852 (995.3 MiB) TX bytes:720589847 (687.2 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:56688095 errors:0 dropped:0 overruns:0 frame:0
TX packets:107523935 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5055776575 (4.7 GiB) TX bytes:149122794794 (138.8 GiB)
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:107799858 errors:0 dropped:0 overruns:0 frame:0
TX packets:56622356 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:147645877687 (137.5 GiB) TX bytes:5559983349 (5.1 GiB)
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:1222 errors:0 dropped:0 overruns:0 frame:0
TX packets:1222 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:133810 (130.6 KiB) TX bytes:133810 (130.6 KiB)
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:40691 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:7978603 (7.6 MiB)
wlan1 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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:40691 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:7978603 (7.6 MiB)
Just wondering could I please ask some questions on the command you executed above. I have tried to run similar configs as what you have done, see below .sh
file. But as soon as I execute this, I lost connection to my router, both though SSH
or the Luci Web Interface (192.168.1.1)
.
#!/bin/sh
#run this command before running this config: $chmod +x <filename.sh>
ovs-vsctl add-br ovs-br
brctl delif br-lan eth0.1
ovs-vsctl add-port ovs-br eth0
ovs-vsctl add-port ovs-br eth0.2
ovs-vsctl add-port ovs-br eth0.1
ovs-vsctl set-controller ovs-br tcp:192.168.1.203:6633
ifconfig ovs-br up
ifconfig eth0.1 up
exit 0
So I tried again with some modification to the config file where I deleted the IP address of the LAN port which is eth0.1 (similar to your eth1)
then added to the OVS bridge that I have created named ovs-br
. But this time, I could connect to the router through SSH
but I still can not access the internet. Do you have any clue what I'm doing wrong?
#!/bin/sh
#run this command before running this config: $chmod +x <filename.sh>
#delete default bridge
brctl delif br-lan eth0.1
ifconfig br-lan down
brctl delbr br-lan
#create ovs bridge
ovs-vsctl add-br ovs-br
ovs-vsctl add-port ovs-br eth0.1
ip link set eth0.1 up
sleep 3
#up the interfaces
ip addr add 192.168.1.1/24 dev ovs-br
sleep 3
ip link set ovs-br up
sleep 3
#add route for '192.168.1.0' traffics through interface 'ovs-br'
ip route add 192.168.1.0/24 via 0.0.0.0 dev ovs-br
sleep 3
#config boradcast and ipv6 to the same as 'br-lan' before
ifconfig ovs-br broadcast 192.168.1.255
sleep 3
ip -6 addr add xxxx:xxxxx:xxxx::1/60 dev ovs-br scope global
sleep 3
exit 0
$ ovs-vsctl show
d4a99c27-a9ad-4d57-ac81-f83d92e4aaf1
Bridge ovs-br
Controller "tcp:192.168.1.203:6633"
Port ovs-br
Interface ovs-br
type: internal
Port "eth0.1"
Interface "eth0.1"
Port "eth0.2"
Interface "eth0.2"
ovs_version: "2.11.6"
My original routing table:
$ 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 eth0.2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 br-lan
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.2
Routing table after running my new "config.sh" above:
$ 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 eth0.2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 ovs-br
192.168.3.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0.2
New ifconfig:
$ ifconfig
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:164488040 errors:0 dropped:0 overruns:3 frame:0
TX packets:164146639 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1043657852 (995.3 MiB) TX bytes:720589847 (687.2 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:56688095 errors:0 dropped:0 overruns:0 frame:0
TX packets:107523935 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:5055776575 (4.7 GiB) TX bytes:149122794794 (138.8 GiB)
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:107799858 errors:0 dropped:0 overruns:0 frame:0
TX packets:56622356 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:147645877687 (137.5 GiB) TX bytes:5559983349 (5.1 GiB)
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:1222 errors:0 dropped:0 overruns:0 frame:0
TX packets:1222 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:133810 (130.6 KiB) TX bytes:133810 (130.6 KiB)
ovs-br 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: xxxx:xxxx:xxxx::1/60 Scope:Global
inet6 addr: xxxx::xxxx:xxxx:xxxx:xxxx/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2055 errors:0 dropped:13 overruns:0 frame:0
TX packets:1901 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:352819 (344.5 KiB) TX bytes:536139 (523.5 KiB)
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:40691 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:7978603 (7.6 MiB)
wlan1 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:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:40691 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:7978603 (7.6 MiB)
Much appreciate your help again!