NickJongens/PiEvilTwin

Question

Closed this issue · 2 comments

Hello,
doesit work with a raspberrypie 4 too ?:D

I got this working with a few modifications on a pi zero with another wifi adapter attached.

Pi Evil Twin Git Clone

git clone https://github.com/NickJongens/PiEvilTwin.git

Additional Configurations

Configure wpa_supplicant for wlan0 as access point

To configure wpa_supplicant create these files with your settings for country=, ssid=, psk= and maybe frequency= You can just copy and paste this in one block to your command line beginning with cat and including EOF (delimiter EOF will not get part of the file):

nano /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="HOME NETWORK"
mode=2
key_mgmt=WPA-PSK
psk="verySecretPassword"
frequency=2412
}

chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan0.conf
systemctl disable wpa_supplicant.service
systemctl enable wpa_supplicant@wlan0.service
rfkill unblock 0

Configure wpa_supplicant for wlan1 as client

nano /etc/wpa_supplicant/wpa_supplicant-wlan1.conf

country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="HOME NETWORK"
psk="PASSWORD"
}

chmod 600 /etc/wpa_supplicant/wpa_supplicant-wlan1.conf
systemctl disable wpa_supplicant.service
systemctl enable wpa_supplicant@wlan1.service
rfkill unblock 2

Configure interfaces

Create these two files:

nano /etc/systemd/network/08-wlan0.network
[Match]
Name=wlan0
[Network]
Address=192.168.0.0/24

IPMasquerade is doing NAT

IPMasquerade=yes
IPForward=yes
DHCPServer=yes
[DHCPServer]
DNS=84.200.69.80 1.1.1.1

nano /etc/systemd/network/12-wlan1.network
[Match]
Name=wlan1
[Network]
DHCP=yes
EOF

Reboot.

That's it.

The second wifi adapter allows you to ssh in if you want to run it headless.