-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrepeater.sh
More file actions
58 lines (43 loc) · 1.41 KB
/
repeater.sh
File metadata and controls
58 lines (43 loc) · 1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# first connect to the device
# connect to it's access point from your laptop
# then connect with ssh to get shell access
ssh root@172.16.42.1
# show status of wireless interfaces
iwconfig
# bring wlan1 up
ifconfig wlan1 up
# check status of the link
# will report 'Not Connected'
iw dev wlan1 link
# scan for networks
iw dev wlan1 scan | less
# choose an SSID from scan output
# and connect to it
# replace [SSID] with your SSID
iw dev wlan1 connect -w [SSID]
# now get an IP address on wlan1
dhcpcd -k wlan1
dhcpcd wlan1
# you can check for an IP address with ifconfig
ifconfig wlan1
# now add the default gateway for internet access
# you may need to replace the ip 10.0.0.1 with the correct gateway
# you can figure out the gateway using the ifconfig wlan1 command
# the gateway is the ip address of the access point are connected to
route add default gw 10.0.0.1
# and now set up ip forwarwarding
iptables -X
iptables -F
iptables -A FORWARD -i wlan1 -o wlan0 -s 172.16.42.0/24 -m state --state NEW -j ACCEPT
iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A POSTROUTING -t nat -j MASQUERADE
# we should be online
# test by pinging the gateway
# remember that 10.0.0.1 might not be the gateway for a given access point
ping 10.0.0.1
# test by pinging the internet
ping winterroot.net
# and finally
# open a new terminal on your laptop
# and ping winterroot.net
# you are online if that works!