0

So I have the Raspberry Pi 4 connected to the internet via ethernet cable. I then set it up as an access point so I can connect to it wirelessly through a laptop.

The SSID does indeed show up on my lap, which I am able to connect to. But when I am connected it says "connected, no internet".

How do I go about fixing this? I need this step so I can analyze the packages going through the network.

Thanks in advance.

EDIT: This is the response to the first reply:

pi@raspberrypi:~ $ ip a
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
    link/ether dc:a6:32:19:63:1a brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.57/24 brd 192.168.0.255 scope global dynamic noprefixroute eth0
       valid_lft 86371sec preferred_lft 75571sec
    inet6 2600:8806:100:26c1:12f9:d375:7571:e93e/64 scope global dynamic mngtmpaddr noprefixroute 
       valid_lft 86399sec preferred_lft 86399sec
    inet6 fe80::7dfe:1646:881c:acdd/64 scope link 
       valid_lft forever preferred_lft forever
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether dc:a6:32:19:63:1c brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.23/24 brd 192.168.1.255 scope global deprecated noprefixroute wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::eda6:1950:84b7:4eb6/64 scope link 
       valid_lft forever preferred_lft forever
pi@raspberrypi:~ $ ip r
default via 192.168.0.1 dev eth0 proto dhcp src 192.168.0.57 metric 200 
192.168.0.0/24 dev eth0 proto dhcp scope link src 192.168.0.57 metric 200
Milliways
  • 59,890
  • 31
  • 101
  • 209
zevbda
  • 3
  • 2
  • "connected to the internet via ethernet cable" "I then set it up as an access point" HOW? What did you do? What does ip a and ip r show? – Milliways Jun 10 '20 at 12:44
  • @Milliways I attached a picture with the response. I know I left out information but I'm very new to raspberry pi so I wasn't sure what to include.

    Thanks

    – zevbda Jun 10 '20 at 12:52
  • 1
    @Milliways Ok I changed it to a text – zevbda Jun 10 '20 at 12:58
  • What do you mean different subnets?

    And I configured the raspberry pi wifi using this guide: https://www.raspberrypi.org/documentation/configuration/wireless/access-point-routed.md

    I am mainly just looking to set up the raspberry pi as an access point so I can connect to it with a laptop. Then I want to analyze the network packages going through it.

    Again, very new to this, so if you have any resources I can start looking at I would really appreciate that.

    – zevbda Jun 10 '20 at 13:01
  • Linking to a tutorial does NOT explain what YOU did. I have never seen this tutorial before, it seems to be new and different from the former Access Point tutorial, but you do not seem to have followed it. – Milliways Jun 10 '20 at 13:16
  • I mean, I just followed all the steps in the tutorial from downloading packages and adding to the respective files. And it seems to have worked in the sense I can see the SSID on my laptop.

    But it's just that when I connect to the raspberry pi from my laptop, I don't get any actual internet.

    – zevbda Jun 10 '20 at 13:20
  • If you want help you should list the settings you used - particularly those in the Enable routing and IP masquerading section, but ideally all the config files. You do not appear to have set routing. – Milliways Jun 11 '20 at 00:25

1 Answers1

1

The tutorial you have used should do. But it seems you have missed something. There is a problem with the routing table you have given with ip r (or less cryptic ip route show). There is no entry for the network of the access point, so the kernel does not know where to send ip packages from the access point. That's causing the error ".., no internet". Your routing table should at least look similar to this:

pi@raspberrypi:~ $ ip route show
default via 192.168.0.1 dev eth0 proto dhcp src 192.168.0.57 metric 200
192.168.0.0/24 dev eth0 proto dhcp scope link src 192.168.0.57 metric 200
192.168.1.0/24 dev wlan0 proto kernel scope link src 192.168.1.23 metric 300

So you should check your setup again with focus on the wifi setup.

You can also try another setup which does not need additional helper programs and may have things easier. Have a look at Setting up a Raspberry Pi as an access point - the easy way using section ♦ Setting up an access point and with eth0, with NAT (recommended).

Ingo
  • 42,107
  • 20
  • 85
  • 197
  • Hey so I managed to set up the raspberry pi as an access point.

    But I just have a follow up question if you don't mind.

    So I am trying to analyze packages.

    When I type the command: "sudo tcpdump -i eth0 -v dst 192.168.0.57" it captures the website im on fine.

    However, when I do "sudo tcpdump -i eth0 -v dst 192.168.0.57 and src 192.168.0.1" It doesn't do anything.

    I think my src address is wrong? When I do sudo route -n it says the first gateway IP address is 192.168.0.1 but the destination is 0.0.0.0

    So my question is, how do I fix my src address?

    – zevbda Jun 12 '20 at 01:20
  • Also, when I do ip route show it shows something identical to that, except I get 202 202 and 302 – zevbda Jun 12 '20 at 01:20
  • Hi @zevbda, I could answer your follow up question but there are two things with it: 1) it is a complete new different question and comments are not usable to answer questions. You should open a new question. 2) It is about tcpdump and has nothing to do with Raspberry Pi and out ouf scope here. You would better ask your new question at https://unix.stackexchange.com/ – Ingo Jun 12 '20 at 09:12