0

I have a specific problem and I searched lots of posts and sites but couldn't find a solution. Here is my problem;

a) My tools.

  1. I have a laptop (Ubuntu server 16.04 LTS) with one Ethernet and one wifi interface.

  2. I have a PC (both Windows 10 and Linux Mint) with one Ethernet and one USB wifi interface.

b) What I want.

What I want is to connect to the internet both on PC and laptop using WIFI, and also create a local network between PC and laptop using Ethernet.

c) Problem or Issue.

PC can connect to the internet through WIFI card. The problem is my Ubuntu server. The Ubuntu server is connected to the internet through wifi when my setting inside /etc/network/interfaces is like this:

auto wlp18s0b1
iface wlp18s0b1 inet dhcp
wpa-ssid <ssid-name>
wpa-psk <pass>

but when I change /etc/network/interfaces to assign static ip address to Ethernet, internet connection fails and I can't ping google.com. Below is content of /etc/network/interfaces which results to WIFI internet connection failure:

auto wlp18s0b1
iface wlp18s0b1 inet dhcp
wpa-ssid <ssid-name>
wpa-psk <pass>

auto enp19s0
iface enp19s0 inet static
address 192.168.92.6
netmask 255.255.255.0
gateway 192.168.92.1

and something else, while second /etc/network/interface configuration results in ping google.com to fails. My wifi card is connected to a WIFI hotspot, it only can't reach the internet.

As a side note, I tried both ping -I wlp18s0b1 google.com and ping google.com.

Thanks in advance.

ThunderBird
  • 1,955

1 Answers1

0

I post this question to https://ubuntuforums.org and their respond solved the problem. I just post answer here too. problem was in gateway value for static IP of Ethernet. in fact gateway announce to every device on subnet, if you want access to internet, you should reach this address(gateway address) on private network. by defining gateway for my local network, i added second gateway to my system which overwrite WIFI default gateway.