So, here’s how it goes. I have an old Linksys router which I have my raspberry pi connected to via Ethernet. I SSH to it via my laptop or phone by connecting to my router via WiFi. I want to be able to use the WiFi chip on the Pi to connect to a nearby router which is connected to the internet so that I can download packages or whatever I may need on the pi while at the same time using the Ethernet connection to my offline router so I can SSH to it.
Here is the output of ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.100 netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::c2:b104:6cc3:b0fe prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:99:7f:6e txqueuelen 1000 (Ethernet)
RX packets 110 bytes 10715 (10.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 865 bytes 74304 (72.5 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.0.103 netmask 255.255.254.0 broadcast 192.168.1.255
inet6 fe80::9076:675d:2f7:651a prefixlen 64 scopeid 0x20<link>
ether b8:27:eb:cc:2a:3b txqueuelen 1000 (Ethernet)
RX packets 5795 bytes 1276439 (1.2 MiB)
RX errors 0 dropped 75 overruns 0 frame 0
TX packets 33 bytes 5412 (5.2 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
When I run
iw wlan0 link
I get this
Connected to 50:60:28:40:c9:b1 (on wlan0)
SSID: whcc
freq: 5745
RX: 2041558 bytes (7502 packets)
TX: 4884 bytes (33 packets)
signal: -52 dBm
tx bitrate: 162.0 MBit/s
bss flags:
dtim period: 1
beacon int: 100
So to me it looks like I should be connected to the internet, so I test that with a ping
ping -c 5 www.google.com
And I get
ping: www.google.com: Temporary failure in name resolution
Here’s the output of
ip route
default via 192.168.1.1 dev eth0 src 192.168.1.100 metric 202
default via 192.168.0kernel.1 dev wlan0 src 192.168.0.103 metric 303
192.168.0.0/23 dev wlan0 proto scope link src 192.168.0.103 metric 303
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.100 metric 202
So I’m not sure what the next step is, because the internet isn’t working even though it says it’s connected to the WiFi. If you need more info let me know!
ip route