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.
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:29interfaces
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