Hi I am trying to setup Open vSwitch on OpenWrt to use a different vlan for each physical port. I currently am having an issue with DHCP not issuing an ip address to each ethernet device. Using the command logread -f
, I only see a bunch of messages like
Thu Jun 13 15:16:32 2019 daemon.info dnsmasq-dhcp[12917]: DHCPDISCOVER(ovslan) <mac addr>
Thu Jun 13 15:16:32 2019 daemon.info dnsmasq-dhcp[12917]: DHCPOFFER(ovslan) 192.168.5.186 <mac addr>
Thu Jun 13 15:16:35 2019 daemon.info dnsmasq-dhcp[12917]: DHCPDISCOVER(ovslan) <mac addr>
Thu Jun 13 15:16:35 2019 daemon.info dnsmasq-dhcp[12917]: DHCPOFFER(ovslan) 192.168.5.175 <mac addr>
It looks as if the router is issuing an address to the device but the device never gets the message from the router & never responds back to the router. Before putting ovs onto the router, I had the vlans configured and working properly. Then I read that interfaces within the ovs bridge cannot have its own ip, so I have removed the subnets I created on the vlans. I feel like I am very close and would greatly appreciate any help! Thanks
/etc/config/network
root@OpenWrt:~# cat /etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fdfe:ecc0:6841::/48'
config interface 'lan'
option type 'bridge'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.3.1'
config interface 'wan'
option ifname 'eth1'
option proto 'dhcp'
config interface 'wan6'
option ifname 'eth1'
option proto 'dhcpv6'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option vid '1'
option ports '0t 4'
config switch_vlan
option device 'switch0'
option vlan '2'
option vid '2'
option ports '0t 3'
config switch_vlan
option device 'switch0'
option vlan '3'
option vid '3'
option ports '0t 2'
config switch_vlan
option device 'switch0'
option vlan '4'
option vid '4'
option ports '0t 1'
config interface 'VLAN_1'
option proto 'static'
option ifname 'eth0.1'
config interface 'VLAN_2'
option proto 'static'
option ifname 'eth0.2'
config interface 'VLAN_3'
option proto 'static'
option ifname 'eth0.3'
config interface 'VLAN_4'
option proto 'static'
option ifname 'eth0.4'
config interface 'ovsbr'
option proto 'static'
option netmask '255.255.255.0'
option ipaddr '192.168.5.1'
option ifname 'ovslan'
/etc/config/dhcp
root@OpenWrt:~# cat /etc/config/dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '1h'
option dhcpv6 'server'
option ra 'server'
option ra_management '1'
config dhcp 'wan'
option interface 'wan'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
config dhcp 'ovsbr'
option start '100'
option leasetime '1h'
option limit '150'
option interface 'ovsbr'
option force '1'
I've left wlan0 in br-lan so that I still have wifi access to my router:
root@OpenWrt:~# brctl show
bridge name bridge id STP enabled interfaces
br-lan 7fff.b0c74576511c no wlan0
ovs-vsctl setup
root@OpenWrt:~# ovs-vsctl show
3247eb5e-7ad3-40b3-a048-ef7fec78734b
Bridge ovslan
fail_mode: standalone
Port "eth0"
Interface "eth0"
Port "eth0.4"
Interface "eth0.4"
Port "eth0.2"
Interface "eth0.2"
Port ovslan
Interface ovslan
type: internal
Port "eth0.1"
Interface "eth0.1"
Port "eth0.3"
Interface "eth0.3"
ovs_version: "2.8.5"