1

Currently I have my Pi setup as an access point; It creates its' own network with an SSID and my other devices can connect and exchange messages. For this, I use hostapd and dnsmasq thru wlan0. However after setting this up I tried to push some code to Github from the Pi and noticed my Ethernet connection was no longer there.

Strangely I can see the Pi on my network from my computer and ssh to the Pi just fine thru eth0.

I cannot ping 8.8.8.8 (it hangs).

Here's some settings from the Pi:

ifconfig -a:

eth0      Link encap:Ethernet  HWaddr b8:27:eb:60:61:8b  
          inet addr:192.168.0.154  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::b857:3d7c:ce6:e3ae/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:4503 errors:0 dropped:41 overruns:0 frame:0
          TX packets:1685 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:535713 (523.1 KiB)  TX bytes:249050 (243.2 KiB)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:448 errors:0 dropped:0 overruns:0 frame:0
          TX packets:448 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:30048 (29.3 KiB)  TX bytes:30048 (29.3 KiB)

wlan0     Link encap:Ethernet  HWaddr b8:27:eb:35:34:de  
          inet addr:192.168.42.1  Bcast:192.168.42.255  Mask:255.255.255.0
          inet6 addr: fe80::7618:d067:a66a:5d25/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:102 errors:0 dropped:1 overruns:0 frame:0
          TX packets:106 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6419 (6.2 KiB)  TX bytes:11612 (11.3 KiB)

/etc/network/interfaces:

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

iface eth0 inet static
    address 192.168.0.154
    netmask 255.255.255.0
    gateway 192.168.0.1

allow-hotplug wlan0
iface wlan0 inet static
    address 192.168.42.1
    netmask 255.255.255.0

allow-hotplug wlan1
iface wlan1 inet manual
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

route -n:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.0.242   0.0.0.0         UG    0      0        0 eth0
192.168.0.0     0.0.0.0         255.255.255.0   U     202    0        0 eth0
192.168.42.0    0.0.0.0         255.255.255.0   U     303    0        0 wlan0

cat /etc/resolv.conf:

# Generated by resolvconf
nameserver 127.0.0.1
  • Your question is incomplete - you have not specified what OS or what else you have done. The routing table the gateway is inconsistent. You have ignored the warning "# Please note that this file is written to be used with dhcpcd# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'". – Milliways Oct 9 '18 at 22:59
  • @Milliways thanks for... whatever that was. your crusade against static IPs is noted. – ChumiestBucket Oct 10 '18 at 14:15
  • What is wlan1 configured in /etc/network/interfaces? ifconfig only shows wlan0. How is the computer connected to the RasPi? Is there a switch? From the RasPi: can you ping -I eth0 192.168.0.242 and ping -I eth0 8.8.8.8? – Ingo Oct 11 '18 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.