Follow the instructions on Raspberry Pi:
Take into consideration that we imagined the phone virtual interface of the Raspberry Pi is usb0
.
Set a static IP address to the eth0 which would be router's clients' default gateway. To do it, there is plenty of procedure:
Put lines below to in /etc/dhcpcd.conf
:
Install the DHCP server package:
Configure the DHCP server. At first, create a backup of the config file:
Put lines below to /etc/dnsmasq.conf
:
Enable IP Forwarding to forward router's clientsi packets:
In /etc/sysctl.conf
, uncomment this line:
Follow these commands for the firewall to allow forwarding between interfaces:
Open rc.local
to add command for restoring firewall configuration on each RPi startup:
In /etc/rc.local
, add this line before Exit 0:
Make sure that usb0
is on DHCP mode to get ip address from the phone.
Now, you have configured Raspberry Pi as a bridge for the router to the phone.
In this step, you must disable any static routes and disable the DHCP server of the router because the DHCP requests of the clients must forward to the RPi interface.