BPI-R2 How to Config for NAT

Hi, I want use BPI-R2 like modem on lastest ubuntu image. I want to make NAT, WAN to LAN. How can I make this on Ubuntu Image ? Or Can I make?

that is the link which tell how to config NAT.


Started a separate page for network-setup: http://www.fw-web.de/dokuwiki/doku.php?id=en:bpi-r2:network:start#natrouting

1 Like

Please note that the hardware NAT(HNAT) is NOT supported in current Ubuntu image with 4.4 kernel, all packets will be forwarded by linux kernel, so the performance is not good.

To clarified, to HNAT, we can use the same subset of command, eg: iptables?

Except ledes 4.9 kernel no other kernel currently support hnat.

It seems that hnat needs second gmac (selecting upstream port), i can’t get that working (tried with ledes 4.14 patches) so hnat also failes

I checked the code, in theory the HNAT works if we use iptables to create/delete/modify forwarding rule, but I don’t validate it, can you please do it by following below steps:

  1. Create a forwarding rule
  2. Make sure the traffic is available,
  3. Check the all forwarding entries in hardware, please use the debugfs hnat
  4. And please check if there are few or no interrupts on eth0 and eth1.

Hi, I can forward eth1 packets to eth0 with iptables. It seems fine. How can I measure forwarding performance?

which Kernel do you have running? eth0 and eth1 as direct interfaces are only in 4.4 where no hnat is available.

For hnat you can make

cat /proc/interrupt

Also you can measure throughput with iperf