1

How can I setup interfaces file to be able to connect the Raspberry pi to the internet (4g USB modem) and at the same time to a PC via SSH (ethernet).

My interface file look like this (/etc/network/interface):

# 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 manual

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

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

/etc/dhcpcd.conf looks as follows:-

       interface eth0
       static ip_address=10.1.1.30/24
       static routers=10.1.1.1
       static domain_name_servers=10.1.1.1

I am able to connect via SSH but I lose the internet connection.

Rodrick
  • 161
  • 7
  • AND I'm not sure I understand why you have a problem. I can connect to the internet and other local LAN PCs (as part of 192.168.1.*) from my Rpi. Can you restore to the std install? It should just work (or I don't understand you Q). (But this is still off-topic). Good luck! – shellter Mar 02 '17 at 19:19
  • I think I miss "auto eth0". i will try that (I asked to move this Q btw). – Rodrick Mar 02 '17 at 20:05
  • It doesn't work. I am not able to connect via ssh to a pc (ethernet) and have internet via 4g USB modem at the same time. – Rodrick Mar 02 '17 at 20:37
  • Please describe your minimal physical setup for this problem, i.e. externalnternetConnection->4GBUSBmodem->RPi->{PC1,PC2,...}.. (by editing your Q, don't add this info as a comment!! :-) ) . Don't you have a router or switch in there someplace? Good luck. – shellter Mar 02 '17 at 21:29
  • If you hadn't fiddled with the interfaces file it would work. It doesn't say # For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' for no reason. See How do I set up networking/WiFi/Static IP – Milliways Mar 02 '17 at 22:51
  • If you keep "auto lo" and add "auto eth0", does that solve your problem? Don't disable the loop back interface by removing "auto lo". – Anders Mar 02 '17 at 22:18
  • @Anders if i keep "auto lo" and add "auto eth0" just the ethernet connection works. So I don't get Internet just SSH. – Rodrick Mar 03 '17 at 18:05
  • I updated my setup changing the dhcpcd.conf file ans leaving interfaces by default but I have the same behavior. I am able to connect via SSH but I lose the internet connection. – Rodrick Mar 16 '17 at 17:02

0 Answers0