Skip to content

Latest commit

 

History

History
75 lines (70 loc) · 1.31 KB

wifi to ethernet.md

File metadata and controls

75 lines (70 loc) · 1.31 KB

Raspberry pi-ethernet to wifi repeater

For configuring the system I assume you have installed raspian os with desktop and enabled ssh and/or vnc.

First update date and time:

date

Ouptput:

Sun 26 Jan 18:43:19 IST 2020

Set date and time accordingly:

sudo date -s "Sun 26 Jan 18:43:19 IST 2020"

Update and upgrade system:

sudo apt update && sudo apt full-upgrade -y 

Install dnsmasq.

sudo apt-get install dnsmasq -y

Assign eth0 an IP address. Open:

sudo nano /etc/dhcpcd.conf 

Add to the bottom of the file:

interface eth0
static ip_address=192.168.4.1/24

Save and exit.

Save original dnsmasq.conf

sudo mv /etc/dnsmasq.conf /etc/dnsmasq.conf.orig

Open /etc/dnsmasq.conf

sudo nano /etc/dnsmasq.conf

Add to the bottom of the file:

interface=eth0
dhcp-range=192.168.4.8,192.168.4.250,255.255.255.0,12h

Save and exit.

Edit /etc/sysctl.conf

sudo nano /etc/sysctl.conf

Uncomment

net.ipv4.ip_forward=1

Save and exit.

Open /etc/rc.local

sudo nano /etc/rc.local

Add just above exit 0

iptables -t nat -A  POSTROUTING -o wlan0 -j MASQUERADE

Save and exit.

Reboot system

sudo reboot now

Connect router via ethernet port of Raspberry pi.