I connect to wifi and ifconfig
report 3 interfaces (lo
, eth0
and wlan0
), but I cannot ping anything, including the router.
Only after ifconfig eth0 down
I get to actually use the internet.
What is going on? How do I avoid this problem?
My /etc/network/interfaces
:
auto lo wlan0
iface lo inet loopback
route:
before ifconfig eth0 down
:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.7.1 0.0.0.0 UG 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
192.168.7.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.7.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0
after ifconfig eth0 down
:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.7.1 0.0.0.0 UG 0 0 0 wlan0
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 wlan0
192.168.7.0 0.0.0.0 255.255.255.0 U 2 0 0 wlan0
ifconfig
before ifconfig eth0 down
:
eth0 Link encap:Ethernet HWaddr 00:90:f5:a6:6c:de
inet addr:192.168.7.100 Bcast:192.168.7.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Interrupt:45
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:16436 Metric:1
RX packets:430 errors:0 dropped:0 overruns:0 frame:0
TX packets:430 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:34157 (34.1 KB) TX bytes:34157 (34.1 KB)
wlan0 Link encap:Ethernet HWaddr 74:f0:6d:27:3e:4d
inet addr:192.168.7.156 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::76f0:6dff:fe27:3e4d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:58 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:878 (878.0 B) TX bytes:10870 (10.8 KB)
after ifconfig eth0 down
:
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:16436 Metric:1
RX packets:1435 errors:0 dropped:0 overruns:0 frame:0
TX packets:1435 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:116494 (116.4 KB) TX bytes:116494 (116.4 KB)
wlan0 Link encap:Ethernet HWaddr 74:f0:6d:27:3e:4d
inet addr:192.168.7.156 Bcast:192.168.7.255 Mask:255.255.255.0
inet6 addr: fe80::76f0:6dff:fe27:3e4d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:63915 errors:0 dropped:0 overruns:0 frame:0
TX packets:50926 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:95400944 (95.4 MB) TX bytes:4750543 (4.7 MB)
By looking at the comments & I've added as an answer expanding more.
Possible cause is that IP's are assigned to the interface statically instead requesting automatically by adding a gatway too (just an assumption). If there are multiple gateways though the subnet is same, system does not know where to look into unless there's a persistent/static route added separately.
eth0
to request IP from an available DHCP server (see below screen);And as you requested, all saved network profiles can be found under system-connections directory. You may edit/delete in there but I'd recommend to use the GUI if you're to create a new connection profile. Below are the command to view your current network profiles.
Hope this helps!! :)
You probably have problem with multiple gateways. If you do not go too internet thought eth0, you simple can erase gateway setting for eth0 card. Averting is ok to have 3 interfaces when you are connected to wifi [lo, eth0 and wlan0].
If this don't solve your problem please give me output from command ifconfig and route.
solution from @AzkerM:
network manager
(top right corner) -->edit connections
-->wired
tabedit
-->IPv4 settings
isAutomatic DHCP
sudo service network-manager restart