Skip to content

ulx3s networking

kost edited this page Apr 19, 2020 · 5 revisions

Interfaces

x.x.x.x = FPGA IP address (PPP interface)

y.y.y.y = ESP32 IP address (ESP32 wireless interface)

Basic networking between Saxon and ESP32

You need to configure PPP according to instructions described here: https://github.com/emard/esp32ppp

Acccesing Internet from Saxon Linux

If your router supports static routes

Configure your ESP32 to connect via PPP to Ulx3s SaxonSoc Linux. After that you just need to add static host route to the IP of the FPGA PPP side and gateway should be ESP32 IP address. If you have Linux on your router it is equvivalent of:

route add -host x.x.x.x gw y.y.y.y

OpenWRT configuration

Following is sample OpenWRT configuration:

config 'route' 'saxon'
        option 'interface' 'lan'
        option 'target' 'x.x.x.x'
        option 'netmask' '255.255.255.255'
        option 'gateway' 'y.y.y.y'

If your router does not support static routes

If your router does not support static routes, but you have some Linux machine on the network. You can configure your machine to provide Internet for your SaxonSoc Linux. Of course, you need to setup PPP link between ESP32 and FPGA. Next, you need to configure your Linux machine on the network to provide Internet connectivity for your SaxonSoc Linux.

On your Linux machine, issue following commands:

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables --table nat --append POSTROUTING -s x.x.x.x -j MASQUERADE
iptables --append FORWARD -d x.x.x.x -j ACCEPT

Credits

  • Paul Ruiz
  • EMARD
  • kost