This blog post is about our current EV3 robot we're planning to use in the 2023/2024 FLL competition. Some features: 2 large motors for steering. 2 medium motors for attachments. 2 colour sensors for picking up the white and black lines, also used for line squaring. 1 gyro sensor. To enable attachments to be changed as quickly as possible we're using gravity to keep the gears connected, i.e. you don't need to fasten anything to the robot. Every attachment has 2x 12 tooth double bevel gear (part 32270) which comes in contact with the 2x 20 tooth double bevel gears (part 32269) on the robot. The medium motors are horizontally aligned on the robots, but we use 12 tooth double bevel gears to convert that to vertical alignments. These in turn are connected to 20 tooth double bevel gears, and the attachments in turn connect to these 20 tooth double bevel gears with their 12 tooth double bevel gears. The complete robot is modelled in Bricklink Studio 2 . You can download the rob
This post will explain how to set up your OpenWRT router to connect to two networks and configure it to route the traffic to the correct network. In this case we will connect both to a corporate network (i.e. enabling you to access the corporate network) and the internet (via an Internet Service Provider). Although most corporate networks allow you to access the internet they usually block specific ports (e.g. for Remote Desktop) and apply all sorts of weird and wonderful restrictions.
I'm using an old Linksys WRT54GL with OpenWRT Backfire 10.03.1. Later OpenWRT releases can't run on the WRT54GL due to limited memory, but OpenWRT 10.03.1 is capable enough of doing this type of work.
To access the corporate network I'm using the WAN port on the router (eth0.1), mapped to interface WAN.
For access to the internet I'm running Wifi in client mode (wl0), mapped to interface WWAN.
In principle it does not matter how you connect to the different networks - it could be via 3G, VPN or whatever other connection - as long as you can connect you can configure the router to route traffic to the different connections. In fact you can connect to more than two networks if you want to.
For the corporate network there's not much setup to do. OpenWRT will by default use eth0.1 for interface WAN. Make sure you get an IP address on eth0.1 either by using the web interface or typing "ifconfig" in a SSH session.
You also need to determine the scope of the corporate network you need to access. Usually corporate networks are larger than the subnet you're connected to. Ping every machine on the corporate network you'll need to access, and make note of every IP address outside of the subnet you're connected to. This includes the DNS servers.
In my case I get the following ifconfig back for eth0.1:
eth0.1 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:11.23.8.81 Bcast:11.23.8.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1285412 errors:0 dropped:0 overruns:0 frame:0
TX packets:69531 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:95851366 (91.4 MiB) TX bytes:7617381 (7.2 MiB)
This means by default I can access every IP on the 11.23.8.x subnet. But by pinging machines on the network I determined I also need access outside of this subnet:
11.9.43.x
11.11.21.x
11.12.6.x
11.12.18.x
11.12.62.x
The last three I can group into one big 11.12.x.x subnet.
To add static routes you can use the Static Routes option under the Network menu. Specify the network - in this case wan - plus the target and netmask. In my case this becomes:
wan 11.9.43.0 netmask 255.255.255.0
wan 11.11.21.0 netmask 255.255.255.0
wan 11.12.0.0 netmask 255.255.0.0
Note 1: Although all the IP addresses above are on the 11.x.x.x subnet it's probably not a good idea to add the complete 11.x.x.x subnet, albeit possible. The golden rule is to only map the ranges you really need.
Note 2: With only one WAN connection you will have access to all IP addresses from your network. But once you add another WAN connection with a lower metric you'll lose the access.
To set up the internet access over Wifi you need to configure it to connect to the correct network. The web interface makes it an easy task. Simply go to Network - Wifi - Click Scan. Pick the Wifi network you want to join and click "Join Network". Choose replace wireless configuration, keep the name of the network "wwan" (Wireless WAN) and keep the firewall zone "wan". Click on Submit.
Now because we want to route all traffic on wifi (WWAN) by default and only route to the corporate network (WAN) when we need to we need to set up different metrics on the interfaces. The metric defines the sequence the router will access different interfaces. To make WWAN the default one we need to have a lower metric on WWAN as on WAN. In this case I'll assign a metric of 10 to WWAN and 20 to WAN. From the web interface Go to Network - Interfaces - WWAN - Advanced settings and set "Use gateway metric" to 10, then click on Save. Do the same for WAN but use a metric of 20. Then click on Save & Apply. When you go back to the Status screen it should now display the wifi settings under IPv4 WAN Status.
To test you setup you can first try to ping IP address on the corporate network. Then try to ping using server names instead of IP addresses - it should resolve the IP address from the corporate network's DNS server. Then try to ping any machine on the internet, e.g. www.google.com.
I'm using an old Linksys WRT54GL with OpenWRT Backfire 10.03.1. Later OpenWRT releases can't run on the WRT54GL due to limited memory, but OpenWRT 10.03.1 is capable enough of doing this type of work.
To access the corporate network I'm using the WAN port on the router (eth0.1), mapped to interface WAN.
For access to the internet I'm running Wifi in client mode (wl0), mapped to interface WWAN.
In principle it does not matter how you connect to the different networks - it could be via 3G, VPN or whatever other connection - as long as you can connect you can configure the router to route traffic to the different connections. In fact you can connect to more than two networks if you want to.
For the corporate network there's not much setup to do. OpenWRT will by default use eth0.1 for interface WAN. Make sure you get an IP address on eth0.1 either by using the web interface or typing "ifconfig" in a SSH session.
You also need to determine the scope of the corporate network you need to access. Usually corporate networks are larger than the subnet you're connected to. Ping every machine on the corporate network you'll need to access, and make note of every IP address outside of the subnet you're connected to. This includes the DNS servers.
In my case I get the following ifconfig back for eth0.1:
eth0.1 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:11.23.8.81 Bcast:11.23.8.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1285412 errors:0 dropped:0 overruns:0 frame:0
TX packets:69531 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:95851366 (91.4 MiB) TX bytes:7617381 (7.2 MiB)
This means by default I can access every IP on the 11.23.8.x subnet. But by pinging machines on the network I determined I also need access outside of this subnet:
11.9.43.x
11.11.21.x
11.12.6.x
11.12.18.x
11.12.62.x
The last three I can group into one big 11.12.x.x subnet.
To add static routes you can use the Static Routes option under the Network menu. Specify the network - in this case wan - plus the target and netmask. In my case this becomes:
wan 11.9.43.0 netmask 255.255.255.0
wan 11.11.21.0 netmask 255.255.255.0
wan 11.12.0.0 netmask 255.255.0.0
Note 1: Although all the IP addresses above are on the 11.x.x.x subnet it's probably not a good idea to add the complete 11.x.x.x subnet, albeit possible. The golden rule is to only map the ranges you really need.
Note 2: With only one WAN connection you will have access to all IP addresses from your network. But once you add another WAN connection with a lower metric you'll lose the access.
To set up the internet access over Wifi you need to configure it to connect to the correct network. The web interface makes it an easy task. Simply go to Network - Wifi - Click Scan. Pick the Wifi network you want to join and click "Join Network". Choose replace wireless configuration, keep the name of the network "wwan" (Wireless WAN) and keep the firewall zone "wan". Click on Submit.
Now because we want to route all traffic on wifi (WWAN) by default and only route to the corporate network (WAN) when we need to we need to set up different metrics on the interfaces. The metric defines the sequence the router will access different interfaces. To make WWAN the default one we need to have a lower metric on WWAN as on WAN. In this case I'll assign a metric of 10 to WWAN and 20 to WAN. From the web interface Go to Network - Interfaces - WWAN - Advanced settings and set "Use gateway metric" to 10, then click on Save. Do the same for WAN but use a metric of 20. Then click on Save & Apply. When you go back to the Status screen it should now display the wifi settings under IPv4 WAN Status.
To test you setup you can first try to ping IP address on the corporate network. Then try to ping using server names instead of IP addresses - it should resolve the IP address from the corporate network's DNS server. Then try to ping any machine on the internet, e.g. www.google.com.
Comments