Hello everyone, this is my first post, I am working with a raspberry pi 3 b+ and OpenWrt, I configured the lan port to receive a static IP from the main router 192.168.0.20 to access the internet, I have also configured an eth1 port with the IP static 192.168.1.1 and a wifi zone 192.168.2.1, both work well, I can access the internet via eth1 or wifi, but when assigning the eth1 and wifi port to the controller stop working, eth1 is not recognized and I get an unidentified network and I can no longer access the wifi network, the lan port is on the same network as the controller, the switch is displayed on the controller openflow but when connecting a PC to eth1 it is recognized but it does not give me the expected IP 192.168.1.20 which is the configured one, I was wondering if I should enable the traffic in the controller or is it an error in the assignment from my ports to the ODL controller, if someone can help me I would appreciate it since it is part of my degree work.
Thanks for responding, I was referring to the fact that I can no longer connect to the Wi-Fi network and when connecting a device to eth1 I get "network not identified".
This is my bash file to map the ports.
MYIP=192.168.0.20
CTLIP=192.168.0.234
DPID=0000000000000002
SW=br0
DPPORTS="phy0-ap0 eth1"
VSCTL="ovs-vsctl --db=tcp:$MYIP:9999"
OVSDB=/tmp/ovs-vswitchd.conf.db
rm /tmp/.ovs-vswitchd.conf.db.~lock~
rm -f $OVSDB
ovsdb-tool create $OVSDB /usr/share/openvswitch/vswitch.ovsschema
ovsdb-server $OVSDB --remote=ptcp:9999:$MYIP --remote=punix:/var/run/openvswitch/db.sock --pidfile --detach
sleep 5
ovs-vswitchd tcp:$MYIP:9999 --pidfile --detach &
$VSCTL add-br $SW
$VSCTL set bridge $SW protocols=OpenFlow13,OpenFlow10
for i in $DPPORTS ; do
PORT=$i
ifconfig $PORT up
$VSCTL add-port $SW $PORT
done
$VSCTL set bridge $SW other-config:datapath-id=$DPID
$VSCTL set-controller $SW tcp:$CTLIP:6633
$VSCTL set-fail-mode br0 secure
My goal is to control firewall rules in the controller like enable to disable ICMP between devices.
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </> " button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
It is not necessary that they be on different networks. I did it to test before if they were on the same network 192.168.1.1.
This is the content of the files.
Sorry if my English is not the best.
root@OpenWrt:~# ubus call system board
{
"kernel": "5.15.162",
"hostname": "OpenWrt",
"system": "ARMv8 Processor rev 4",
"model": "Raspberry Pi 3 Model B Plus Rev 1.3",
"board_name": "raspberrypi,3-model-b-plus",
"rootfs_type": "ext4",
"release": {
"distribution": "OpenWrt",
"version": "23.05.4",
"revision": "r24012-d8dd03c46f",
"target": "bcm27xx/bcm2710",
"description": "OpenWrt 23.05.4 r24012-d8dd03c46f"
}
}
root@OpenWrt:~# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd2d:4d79:997b::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option ipaddr '192.168.0.20'
option netmask '255.255.255.0'
option ip6assign '60'
option gateway '192.168.0.1'
list dns '8.8.8.8'
list dns '8.8.4.4'
config interface 'eth1'
option proto 'static'
option device 'eth1'
option ipaddr '192.168.1.1'
option netmask '255.255.255.0'
list dns '8.8.8.8'
list dns '8.8.4.4'
config interface 'wifi'
option proto 'static'
option ipaddr '192.168.2.1'
option netmask '255.255.255.0'
list dns '8.8.8.8'
list dns '8.8.4.4'
Remove the ignore line and it will start working.
These two networks will not have access to any upstream network or each other:
You don't have a wan interface, so forwarding to the wan zone does nothing.
You probably want to foward to the lan zone, but this still won't work unless you either enable masquerading on the lan firewall zone or configure static routes on the upstream router (if it's supported).
Yes, DHCP is disabled because the PC connected to eth1 has a static IP assigned, with DHCP enabled the same thing happens, apart from using the raspberry I also did tests with the mikrotik rb951g-2hnd router where I do have a wan interface and how I say it works well, although I am new with OpenWrt I managed to configure br-lan, wan and the wifi zone to have access to the internet and correct operation like a conventional switch. My problem is when creating the br0 bridge with openvswitch and assigning the different interfaces to it. I don't know if maybe I'm making mistakes when assigning the ports to the openflow br0 bridge.
The same port can't be in two bridges. I'm not sure what you're intending to do but it likely can be done entirely with UCI. If you're using a separate configuration system you would need to set ports aside to be managed by that system and not reference them at all in UCI.