Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
can not connect to internet?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Tue Oct 07, 2014 8:14 am    Post subject: can not connect to internet? Reply with quote

Hi,

I do not know if it has to do to that problem, however, I added NetworkManager and wifi card to one of my machines,
and suddenly the wired Internet connection was stopped.
ifconfig seems ok so I do not know what went wrong.
Due to this problem I can not paste here command's output but I will try to write down here the relevant details.

EDIT: This comand is ok:
Code:
ping -c 3 8.8.8.8

but no connection through firefox... strange
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”


Last edited by pmam on Thu Oct 09, 2014 6:51 pm; edited 2 times in total
Back to top
View user's profile Send private message
gerdesj
l33t
l33t


Joined: 29 Sep 2005
Posts: 621
Location: Yeovil, Somerset, UK

PostPosted: Tue Oct 07, 2014 6:38 pm    Post subject: Re: can not connect to internet? Reply with quote

Can you resolve hostnames:

Code:

$host www.google.com
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Tue Oct 07, 2014 6:50 pm    Post subject: Reply with quote

Dear gerdesj,

Quote:
Can you resolve hostnames:

Very nice question... and the answer is NO -
Do not know what has changed...
Please advise!

Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6960

PostPosted: Tue Oct 07, 2014 7:41 pm    Post subject: Reply with quote

You must check your /etc/resolv.conf content.
If you want test and use google dns just do
Code:
echo nameserver 8.8.8.8 >> /etc/resolv.conf
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Tue Oct 07, 2014 7:44 pm    Post subject: Reply with quote

pmam,

What do you have in /etc/resolv.conf ?
You need at least one nameserver line.

If ifconfig shows both wired and wireless interfaces connected in the same subnet that wont work.
Stop one of the interfaces.

The output of route will also help. You may have at most one default route.
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Tue Oct 07, 2014 8:40 pm    Post subject: Reply with quote

Dear NeddySeagoon & krinn,

You are right!
Probably my actions with the wireless card and networkmanager, changed /etc/resolv.conf content:
I checked this file in other machine and found out this missing line: nameserver 8.8.8.8 , as you noted, so I added it:
Code:
# Generated by NetworkManager
nameserver 8.8.8.8

Now I can connect to Internet! :D
Can you please add short explanation - Why this line - at least one default route - is essential?
I did not find this demand in the documents.

Quote:
If ifconfig shows both wired and wireless interfaces connected in the same subnet that wont work.
Stop one of the interfaces.

I stopped wireless - However, what is the right way to configure wired & wireless in regards to ifconfig below?
Code:
ifconfig
enp2s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.0.6  netmask 255.255.255.0  broadcast 10.0.0.255                                                                                                                 
        inet6 fe80::21d:7dff:fe70:7eb4  prefixlen 64  scopeid 0x20<link>                                                                                                           
        ether 00:1d:7d:70:7e:b4  txqueuelen 1000  (Ethernet)                                                                                                                       
        RX packets 389166  bytes 255004442 (243.1 MiB)                                                                                                                             
        RX errors 0  dropped 0  overruns 0  frame 0                                                                                                                                 
        TX packets 421782  bytes 161262972 (153.7 MiB)                                                                                                                             
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0                                                                                                                 
                                                                                                                                                                                   
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536                                                                                                                                       
        inet 127.0.0.1  netmask 255.0.0.0                                                                                                                                           
        inet6 ::1  prefixlen 128  scopeid 0x10<host>                                                                                                                               
        loop  txqueuelen 0  (Local Loopback)                                                                                                                                       
        RX packets 32  bytes 1922 (1.8 KiB)                                                                                                                                         
        RX errors 0  dropped 0  overruns 0  frame 0                                                                                                                                 
        TX packets 32  bytes 1922 (1.8 KiB)                                                                                                                                         
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0                                                                                                                 
                                                                                                                                                                                   
wlp3s0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500                                                                                                                               
        ether 00:1d:0f:b6:67:89  txqueuelen 1000  (Ethernet)                                                                                                                       
        RX packets 0  bytes 0 (0.0 B)                                                                                                                                               
        RX errors 0  dropped 0  overruns 0  frame 0                                                                                                                                 
        TX packets 0  bytes 0 (0.0 B)                                                                                                                                               
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0


Thanks a lot
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”


Last edited by pmam on Tue Oct 07, 2014 9:31 pm; edited 2 times in total
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


Joined: 05 Jul 2003
Posts: 42559
Location: 56N 3W

PostPosted: Tue Oct 07, 2014 9:20 pm    Post subject: Reply with quote

pmam,

Heres my kernel routing table by way of an illustration. Its there twice so you can see hostnames and IP addresses.
Code:
roy@NeddySeagoon_Static ~ $ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         router          0.0.0.0         UG    2      0        0 eth0
loopback        *               255.0.0.0       U     0      0        0 lo
loopback        localhost       255.0.0.0       UG    0      0        0 lo
192.168.100.0   *               255.255.255.0   U     0      0        0 eth0
roy@NeddySeagoon_Static ~ $ route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         192.168.100.253 0.0.0.0         UG    2      0        0 eth0
127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo
127.0.0.0       127.0.0.1       255.0.0.0       UG    0      0        0 lo
192.168.100.0   0.0.0.0         255.255.255.0   U     0      0        0 eth0
roy@NeddySeagoon_Static ~ $


When a packet is te be routed. the kernel looks at the desinatian IP in the header and applies the rutes from the bottom of the list, working towards the top.
If a packet is destined for 192.168.100.0/24, its just sent out of eth0 as its on my local sub net. No gateway is required.
Lets skip 127.0.0.0.
Packets that get to the top of the list, 0.0.0.0 matches any destination IP, are sent to 192.168.100.253, which is my next hop towards the internet.
My PC has no idea how to reach such IPs so the packet is sent onwards.

This process is repeated at every 'hop' until the destination is reached. traceroute shows this.
Code:
# traceroute -I google.com
traceroute to google.com (74.125.230.130), 30 hops max, 60 byte packets
 1  router (192.168.100.253)  1.079 ms  1.081 ms  1.099 ms
 2  losubs.subs.dsl1.wh-man.zen.net.uk (62.3.87.145)  16.665 ms  16.888 ms  16.900 ms
 3  no-dns-yet-62-3-80-197.zen.co.uk (62.3.80.197)  17.569 ms  17.747 ms  17.762 ms
 4  ge-3-0-0-0.cr2.th-lon.zen.net.uk (62.3.80.45)  23.602 ms  24.027 ms  24.028 ms
 5  ge-2-0-0-0.cr1.th-lon.zen.net.uk (62.3.80.41)  24.041 ms  24.054 ms  24.069 ms
 6  72.14.217.190 (72.14.217.190)  24.083 ms  22.983 ms  22.986 ms
 7  209.85.244.184 (209.85.244.184)  23.809 ms  22.537 ms  24.100 ms
 8  209.85.250.171 (209.85.250.171)  22.572 ms  22.575 ms  22.575 ms
 9  lhr08s05-in-f2.1e100.net (74.125.230.130)  22.367 ms  23.021 ms  23.463 ms

The above shows my route to google .com, so my connection to google.com is through eight other systems.
The first hop is my router, as described above. It has a default route to my ISP ...
_________________
Regards,

NeddySeagoon

Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail.
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 6957
Location: Saint Amant, Acadiana

PostPosted: Tue Oct 07, 2014 11:19 pm    Post subject: Reply with quote

Nameserver is not route, actually. It is resolver, please see http://en.wikipedia.org/wiki/Domain_Name_System
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Wed Oct 08, 2014 11:11 am    Post subject: Reply with quote

NeddySeagoon,

Thanks for your nice explanation - It gives a practical point of view,
that help to figure out what i s going on there... inside the box.

I am trying to configure again wireless interface with NetworkManager,
and find out that during the configuration this line: 'nameserver 8.8.8.8' is deleted from /etc/resolv.conf -
Strange but it happens.. Also wireless is not working OK -sometimes yes and not -
So I will open a new topic...
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
Roman_Gruber
Advocate
Advocate


Joined: 03 Oct 2006
Posts: 3806
Location: Austro Bavaria

PostPosted: Wed Oct 08, 2014 12:39 pm    Post subject: Reply with quote

why do you use network manager.

make the connection by hand as user root. ususally dhcpcd interfacename is enough for that, you can automate this too but i do it by typing dhcpcd
Back to top
View user's profile Send private message
RazielFMX
l33t
l33t


Joined: 23 Apr 2005
Posts: 835
Location: NY, USA

PostPosted: Wed Oct 08, 2014 12:49 pm    Post subject: Reply with quote

tw04l124 wrote:
why do you use network manager.

make the connection by hand as user root. ususally dhcpcd interfacename is enough for that, you can automate this too but i do it by typing dhcpcd


Network Manager is great when you move between networks frequently. I used to use it years ago on my laptop.

Are you using dhcpcd or dhclient with NetworkManager? If you aren't sure, you can run and post the output of the following and it will give us a clue:

Code:
equery uses networkmanager
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Oct 08, 2014 12:53 pm    Post subject: Reply with quote

RazielFMX wrote:
Network Manager is great when you move between networks frequently.


You can also use dhcpcd-gtk or dhcpcd-qt (if the updated ebuilds ever hit portage) for the same job.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Wed Oct 08, 2014 1:03 pm    Post subject: Reply with quote

RazielFMX,

I am using static IP for wired interfaces - I have devices mounted to machines - so should be an order.
However for wireless maybe I can use dhcpd -but still prefer static -
could be a problem if wireless will take by chance one of the static IP - right?
If I will not manage I will do it by hand as tw04l124 said.
Here is the output:
Code:
equery uses networkmanager
[ Legend : U - final flag setting for installation]
[        : I - package is installed with flag     ]
[ Colors : set, unset                             ]
 * Found these USE flags for net-misc/networkmanager-0.9.8.10-r1:
 U I
 + + avahi              : Add avahi/Zeroconf support
 + + bluetooth          : Enable Bluetooth Support
 - - connection-sharing : Use net-dns/dnsmasq and net-firewall/iptables for connection sharing
 + + consolekit         : Use sys-auth/consolekit for session tracking
 - - dhclient           : Use dhclient from net-misc/dhcp for getting ip
 + + dhcpcd             : Use net-misc/dhcpcd for getting ip
 - - gnutls             : Add support for net-libs/gnutls (TLS 1.0 and SSL 3.0 support)
 + + introspection      : Add support for GObject based introspection
 + + modemmanager       : Enable support for mobile broadband devices using net-misc/modemmanager
 + + nss                : Use dev-libs/nss for cryptography
 + + ppp                : Enable support for mobile broadband and PPPoE connections using net-dialup/ppp
 - - resolvconf         : Use net-dns/openresolv for managing DNS information
 - - systemd            : Enable use of systemd-specific libraries and features like socket activation or session tracking
 - - test               : Workaround to pull in packages needed to run with FEATURES=test. Portage-2.1.2 handles this internally, so don't set it in make.conf/package.use anymore
 - - vala               : Enable bindings for dev-lang/vala
 + + wext               : Enable support for the deprecated Wext (Wireless Extensions) API; needed for some older drivers (e.g. ipw2200, ndiswrapper)
 + + wifi               : Enable support for wifi and 802.1x security using net-wireless/wpa_supplicant

Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Oct 08, 2014 1:11 pm    Post subject: Reply with quote

One obvious thought is that there is no DNS solution via DHCP over the wifi link and if NM doesn't know about your static setup it may wipe it out.
IF using NM (or dhcpcd for everything as in the link below), then it needs to know all configuration OR install a tool such as openresolv to be the middleman for you.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
RazielFMX
l33t
l33t


Joined: 23 Apr 2005
Posts: 835
Location: NY, USA

PostPosted: Wed Oct 08, 2014 1:13 pm    Post subject: Reply with quote

Interesting.

I've never attempted static network configuration with Network Manager. Your best bet might be dropping Network Manager and adding dhcpcd to your default run level (if you use OpenRC). You can configure dhcpcd to use static definitions.

You can check out https://wiki.archlinux.org/index.php/Dhcpcd for more on dhcpcd.

If you are using systemd, I would review this:

https://wiki.archlinux.org/index.php/Network_configuration#Static_IP_address

Finally, you can do what @tw04l124 stated and do everything by hand.
Back to top
View user's profile Send private message
RazielFMX
l33t
l33t


Joined: 23 Apr 2005
Posts: 835
Location: NY, USA

PostPosted: Wed Oct 08, 2014 1:15 pm    Post subject: Reply with quote

UberLord wrote:
RazielFMX wrote:
Network Manager is great when you move between networks frequently.


You can also use dhcpcd-gtk or dhcpcd-qt (if the updated ebuilds ever hit portage) for the same job.


A GUI version of dhcpcd! The next time I attempt the insanity of Gentoo on a laptop I will definitely check that out!
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Wed Oct 08, 2014 1:18 pm    Post subject: Reply with quote

RazielFMX wrote:
A GUI version of dhcpcd! The next time I attempt the insanity of Gentoo on a laptop I will definitely check that out!


:)

Just remember to try 0.7.3 or newer. Earlier versions are a touch unreliable and don't work well with the newer dhcpcd's in portage.
Hence me adding the Gentoo ticket in my .sig to try and get dhcpcd-ui updated in portage.
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Wed Oct 08, 2014 1:27 pm    Post subject: Reply with quote

RazielFMX,

Quote:
I've never attempted static network configuration with Network Manager.

I think this may causing to this problem - Till now have not used NetworkManager for static IP -
I did it by hand. But now, I thought it is a good idea to use NM for wireless configuration -
May be it is not OK, and I need to continue configuring by hand the wireless, as well.
I see it also from replies of other guys here...
I need to read the attached links and see how to go a head...
I am using openRC

Thanks
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
pmam
Veteran
Veteran


Joined: 30 Dec 2013
Posts: 1145

PostPosted: Thu Oct 09, 2014 6:42 pm    Post subject: Reply with quote

OK - I see that NetworkManager is not so suitable to my setup -
I already configured wired interface by hand (no GUI)
and want to add wireless interface by hand - but have some issues:

I am not going to use dhcpcd since I need static IP -
I have some mounted devices to machine, so could be some mess using dynamic IP.
I have done according this guide: http://wiki.gentoo.org/wiki/Wifi.
Now trying to follow this guide: https://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=4&chap=4 -
I understand that I have to use wpa_supplicant (or wireless-tools) - right?
Anyway, I installed wpa_supplicant, however, do not figure out what exactly to add to /etc/conf.d/net -
My WIFI router details is: WEP, open, and static IP is needed.
Please advise me how to configure this setup?
_________________
“You can take our property, our sweet homes, even our cloths...
But don't touch the streets, Ah, That's NO, NO, NO!
The streets are our @world's compilable kernel ...”
Back to top
View user's profile Send private message
UberLord
Retired Dev
Retired Dev


Joined: 18 Sep 2003
Posts: 6737
Location: Blighty

PostPosted: Thu Oct 09, 2014 6:48 pm    Post subject: Reply with quote

pmam wrote:
I am not going to use dhcpcd since I need static IP


dhcpcd can setup static addresses as well.
Click the link in my sig!
_________________
Use dhcpcd for all your automated network configuration needs
Use dhcpcd-ui (GTK+/Qt) as your System Tray Network tool
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum