Wi-Fi says connected, but my internet does not work until I turn it on and off I just got my first macbook, an used early 2014 14-inch macbook air, with Mac OS Mojave. And everything works fine but when im connected to the wifi, after like about 20-30 minutes it just stops working. and it always starts working back up when I turn wifi on and off, or when I disconnect off the network, and connect back up.
It says I am still connected to the network, but there is no internet.
I already tried doing a wireless diagnosis and tried contacting apple support multiple times.

UPDATE:

Unused argument: –
Too many arguments to 'show' verb
usage: log show [options] &lt;archive&gt;
   or: log show [options]

description:
    Show the contents of the system log datastore or a log archive.
    Output contains only default level messages unless --info and/or
    --debug are specified.

options:
    --[no-]backtrace              Control whether backtraces are shown
    --[no-]debug                  Control whether "Debug" events are shown
    --[no-]info                   Control whether "Info" events are shown
    --[no-]loss                   Control whether message loss events are shown
    --[no-]signpost               Control whether signposts are shown
    --color &lt;mode&gt;                Control color output (valid: auto, always, none)
    --end &lt;date&gt;                  Display events up to the given end date
    --last &lt;num&gt;[m|h|d]           Display recent events up to the given limit
    --predicate &lt;predicate&gt;       Filter events using the given predicate
    --source                      Annotate output with source file and line-number
    --start &lt;date&gt;                Display events from the given start date
    --style &lt;style&gt;               Output format (valid: syslog, json, compact)
    --timezone local | &lt;tz&gt;       Use the given timezone when displaying event timestamps
    --mach-continuous-time        Print mach continuous time timestamps rather than walltime

valid time formats:
    'Y-M-D H:m:s+zzzz', 'Y-M-D H:m:s', 'Y-M-D', '@unixtime'

predicate usage:
    Filter predicates follow the NSPredicate format described at:
    https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/Predicates/AdditionalChapters/Introduction.html

    For predicate field/type details, see `log help predicates`.


This is what showed up after the last step I was told.



Please help me out if somebody knows what is going on
The Terminal command to show WiFi disconnects for last 24 hours is: 

log show --predicate '(processImagePath contains "kernel") &amp;&amp; (eventMessage contains "AirPort: Link Down")' --style syslog --last 1d


and the output looks like this