Monday, May 6, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 2582  / 3 Years ago, tue, september 14, 2021, 5:29:05

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)

More From » networking

 Answers
0

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.




  • You may click on the nm-applet (enter image description here) & select Edit connections to get the entire network manager preferences or you may achieve this using terminal (press CTRL+ALT+T) & key-in below;



nm-connection-editor            # this will give you below nm-editor screen


enter image description here




  • Navigate to Wired tab, select the profile & click edit or either delete if necessary. If editing, then navigate to IPv4 settings select the Method as Automatic (DHCP) for the eth0 to request IP from an available DHCP server (see below screen);



enter image description here




  • Once done, restart the network manager to re-authenticate to the network.



sudo service network-manager restart


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.



 cd /etc/NetworkManager/system-connections/    # will change in to the directory
ls -l # will display all the profiles in a sequense
sudo rm -fr profile_name # you will need root to add/edit/delete & this will remove a specified profile


Hope this helps!! :)


[#26721] Wednesday, September 15, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
percol

Total Points: 493
Total Questions: 116
Total Answers: 107

Location: Taiwan
Member since Mon, Sep 6, 2021
3 Years ago
percol questions
Thu, Sep 29, 22, 07:42, 2 Years ago
Sat, Jul 16, 22, 21:00, 2 Years ago
Tue, May 30, 23, 19:16, 1 Year ago
Wed, Aug 18, 21, 02:15, 3 Years ago
;