Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Where is my network !?
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
TitiTwister
n00b
n00b


Joined: 08 May 2015
Posts: 18

PostPosted: Mon May 11, 2015 8:19 pm    Post subject: Where is my network !? Reply with quote

Hi world !

So I just finished my second gentoo and both times I got the same problem : I don't have access to internet.

I can't ping ==> connect: Network is unreachable.

So here is my ifconfig : ifconfig

My /etc/conf.d/net : net

The /etc/hosts file : hosts

I'm new to this so hope it's not something stupid to have troubles with ^^

Thanks for your help !

B.T.W. I'm on VMware and my "network adapter" is on Bridged (but it doesn't work on NAT either).
Back to top
View user's profile Send private message
tryn
Guru
Guru


Joined: 21 Dec 2002
Posts: 318
Location: 39.885° N. -88.913° W.

PostPosted: Mon May 11, 2015 8:47 pm    Post subject: Reply with quote

TitiTwister


One thing that might help is this.

Code:
config_eth0="dhcp"


Instead of this.
Code:
#config_eth0="dhcp"


From what you have posted yours is commented out.
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Mon May 11, 2015 8:52 pm    Post subject: Reply with quote

TitiTwister,

What does
Code:
ifconfig -a
show?

An empty or missing net file uses dhcpcd. Did you install dhcpcd, if not you don't have it?

Your hosts file should have the defaults for
Code:
127.0.0.1
::1


The FQDN and its aliases go against the real IP on a static setup or are provided by dhcp if you use dhcp
_________________
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
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6959

PostPosted: Mon May 11, 2015 9:18 pm    Post subject: Reply with quote

Networking for dummies ;)

1/ find your card
Quote:
lspci -k | grep -A5 Ether
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 02)
Subsystem: ASUSTeK Computer Inc. M3A78-EH Motherboard
Kernel driver in use: r8169
Kernel modules: r8169

a/ your card is -> Realtek blahblah
b/ what driver you need -> Kernel driver in use: -> r8169
c/ Kernel modules answer to "Is my driver buildin the kernel or as module" -> Kernel modules -> so build as module
d/ not having the driver, you have no network card working -> network unreachable error

2/ name my interface?
Quote:
ls /sys/class/net/ -l
total 0
lrwxrwxrwx 1 root root 0 1 mai 17:31 eth0 -> ../../devices/pci0000:00/0000:00:1c.2/0000:04:00.0/net/eth0
lrwxrwxrwx 1 root root 0 11 mai 22:45 lo -> ../../devices/virtual/net/lo

a) note that 04:00.0 is the pci ref from lspci output, telling you THAT card is using that name eth0
b) because of udev/systemd madness, that little eth0 could be some cryptic name everyone knows is only made to bug users. To get this back is another story.
c) WTF i have no eth0 thing!!! see #1d
d) WTF i couldn't spell the interface name my card is using! see #2b

4/ build a link to it
Quote:
ln -s /etc/init.d/net /etc/init.d/net.eth0


5/ configure it
Quote:
cat /etc/conf.d/net
config_eth0="192.168.0.4 netmask 255.255.255.0 brd 192.168.0.255"
routes_eth0="default via 192.168.0.100"

a) the via mean "send information to that device", so "set the routing table to send information from eth0 to 192.168.0.100". It is then just your router IP
b) 192.168.0.4 if you use an address not in the same range as your route (so 192.168.0.any) you'll get "network unreachable". Make sure they match.

6/ dns resolving
Quote:
cat /etc/resolv.conf
nameserver 192.168.0.100
nameserver 8.8.8.8
a) nameserver is the server that will translate www.this.com into an IP, so it's the address of someone that will do that for you, in this case, first nameserver is the router, as many router can answer that easy
b) 8.8.8.8 that's google dns resolver, not really the best to use for your privacy, as your IP asking whois is sure gold info to track you. But that's a good one to test and because many users aren't aware of the dns their provider use (do i mean users are lost in space? well, it's network for dummies there)
c) bad dns, not dns setup... -> unknown host error

7/ How can i start it?
Quote:
/etc/init.d/net.eth0 start


8/ It cannot be that easy?
Of course not, NeddySeagoon is know to do it eyes closed, but i don't recommend it. If you have eyes open i'm afraid it is that easy.

In case you are lost, having an ifconfig showing only lo, mean you are a #1d case.


Last edited by krinn on Mon May 11, 2015 9:26 pm; edited 1 time in total
Back to top
View user's profile Send private message
TitiTwister
n00b
n00b


Joined: 08 May 2015
Posts: 18

PostPosted: Mon May 11, 2015 9:21 pm    Post subject: Reply with quote

tryn wrote:
TitiTwister


One thing that might help is this.

Code:
config_eth0="dhcp"


Done and no changes =S

NeddySeagoon wrote:


What does
Code:
ifconfig -a
show?

An empty or missing net file uses dhcpcd. Did you install dhcpcd, if not you don't have it?


I'm pretty sure I did yeah, but how can I check ? Because maybe I did on the 66 previous VM and not this one.

Here the ifconfig -a : ifconfi -a
Back to top
View user's profile Send private message
TitiTwister
n00b
n00b


Joined: 08 May 2015
Posts: 18

PostPosted: Mon May 11, 2015 10:11 pm    Post subject: Reply with quote

krinn wrote:
Networking for dummies ;)

1/ find your card
Quote:
lspci -k | grep -A5 Ether
04:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 02)
Subsystem: ASUSTeK Computer Inc. M3A78-EH Motherboard
Kernel driver in use: r8169
Kernel modules: r8169

a/ your card is -> Realtek blahblah
b/ what driver you need -> Kernel driver in use: -> r8169
c/ Kernel modules answer to "Is my driver buildin the kernel or as module" -> Kernel modules -> so build as module
d/ not having the driver, you have no network card working -> network unreachable error



Ok I don't have the module ... tell me I don't have to do all the kernel config again ...
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6959

PostPosted: Mon May 11, 2015 10:31 pm    Post subject: Reply with quote

No, i won't tell you.

But you need to add that option to your kernel, and (i'm sure you won't like that), you have two choices (well, three in fact):
a) build the driver buildin the kernel -> need recompile, and install it -> make && make install
b) build the driver as module -> need to recompile modules and install them (make modules && make modules_install)
c) If your kernel was so badly built that you lack some symbols and the modules compilation fail, it is well, really just because you did an ugly kernel for networking :)
In this case, you're doom, making it as module or build in, you will have to recompile the kernel AND the modules so they get the new symbols too.
But even you miss to add your network card driver, could we assume you weren't crazy enough to not miss all networking options?

In case you are doom to c) or scared by a) or b) just use c) It is nothing more than just checking the network driver for your card that will force you to check other needed options to enable it, and the "OMG it was so hard to configure" is just limit to typing: make && make modules modules_install && make install

Just to be sure: you know your driver name to use right? I mean, not everyone use r8169, that's the one for my card in my example, and if you don't have that kind of card... Because also i'm unsure if a card under vmware need some vmware driver or just its native one.
Back to top
View user's profile Send private message
TitiTwister
n00b
n00b


Joined: 08 May 2015
Posts: 18

PostPosted: Mon May 11, 2015 10:47 pm    Post subject: Reply with quote

krinn wrote:
a) build the driver buildin the kernel -> need recompile, and install it -> make && make install
b) build the driver as module -> need to recompile modules and install them (make modules && make modules_install)
c) If your kernel was so badly built that you lack some symbols and the modules compilation fail, it is well, really just because you did an ugly kernel for networking :)
In this case, you're doom, making it as module or build in, you will have to recompile the kernel AND the modules so they get the new symbols too.
But even you miss to add your network card driver, could we assume you weren't crazy enough to not miss all networking options?

.


Well I got this : here

So do I need both driver and module ?
If so, how can I do the make && make_install command again ?
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


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

PostPosted: Mon May 11, 2015 11:38 pm    Post subject: Reply with quote

Actually, if you enable it as a module you need to do make modules and make modules_install, this will enable your NIC, no reboot needed.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 6959

PostPosted: Tue May 12, 2015 7:10 am    Post subject: Reply with quote

TitiTwister: you seems a bit lost with "driver" and "module".
That's the same. Say i need the r8169 for my card. I'm going to my kernel source and look where is the r8169 driver.
If i check <*> or <M>, i will have the driver, it's just the handling that will change, but the driver will be there.

<*> the driver is build inside your kernel, it mean everytime your kernel boot, the driver is load (even you don't have the card, it is just load). So if you build it like that, it mean you need to reboot.
<M> the driver is load when you ask it to load, for most people, they will still not need to ask it loaded, as dev manager (eudev, udev...) will load it for you when it see you have a device that need it (but when the device is discovered, and except if the device is hotplug, it is then when booting).
So if you build it as module, you install it, and as your card is not hotplug, you need to ask it loaded: modprobe r8169 (or lazzy ones can just reboot, and it will be discovery at booting by dev manager that will use his little fingers and type <modprobe r8169> for you).

As you fail to see, your pic showing your lspci -k output, still didn't gave you the driver name to use. That's because your kernel doesn't have the driver at all. To get it, you can google that, or wait some users giving you the answer, or browse the kernel and search what driver match it, or redo the <lspci -k> but with a kernel that handle many drivers (including the one you need). That's the kind of kernel you have in installationcd that of course have as many as possible.

But it is more for kernel for dummies than network for dummies ;)
If you need more about kernel, read the linux sea (excellent) from sven http://swift.siphos.be/linux_sea/
Or you can check kernel entry in the gentoo wiki (that sure sucks) http://wiki.gentoo.org
Back to top
View user's profile Send private message
TitiTwister
n00b
n00b


Joined: 08 May 2015
Posts: 18

PostPosted: Tue May 12, 2015 9:07 am    Post subject: Reply with quote

Ok I'm getting close I think ^^

So now I know I need this driver now : AMD PCNet32 PCI support.
Which is now built in my kernel. But still no changes ( it's this one I had before rebooting for the first time ).
The lspci run still show no driver in use.

So now I saw this while rebooting : reboot error

Maybe it's something I don't know.
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2583

PostPosted: Tue May 12, 2015 10:31 am    Post subject: Reply with quote

Are you sure you need or want netmount? Otherwise, remove it.
Code:
# rc-update del netmount

If you need it, have a look at https://wiki.gentoo.org/wiki/Network_dependent_services.
Back to top
View user's profile Send private message
TitiTwister
n00b
n00b


Joined: 08 May 2015
Posts: 18

PostPosted: Tue May 12, 2015 1:31 pm    Post subject: Reply with quote

Ok ok ok

So I managed to make this driver appear on my lspci run.

But when I do a ifconfig -a still no eth0.

And when I do :
Code:
/etc/init.d/net.eth0 start
ERROR: interface eth0 does not exist


So I guess it's still something to do with my kernel but is it still the drivers ?
Back to top
View user's profile Send private message
charles17
Advocate
Advocate


Joined: 02 Mar 2008
Posts: 2583

PostPosted: Tue May 12, 2015 2:31 pm    Post subject: Reply with quote

You should find out what the names of your network interfaces are. That's the reason why netifrc is not recommended.
Try
Quote:
$ dmesg | grep -i 'network interface'
Back to top
View user's profile Send private message
TitiTwister
n00b
n00b


Joined: 08 May 2015
Posts: 18

PostPosted: Tue May 12, 2015 2:35 pm    Post subject: Reply with quote

charles17 wrote:
You should find out what the names of your network interfaces are. That's the reason why netifrc is not recommended.
Try
Quote:
$ dmesg | grep -i 'network interface'


Code:
4.290763] systemd-udevd[1681]: renamed network interface eth0 to eno1677773


THAT MOT******* !!! 8O

So what do I have to do now ? -_-

EDIT:

Ok so I changed the "eth0" everywhere and make a link to it.

So now it's WORKING !!! But is it good to let it this way ?

THANKS everyone you are great !!!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Tue May 12, 2015 7:10 pm    Post subject: Reply with quote

TitiTwister,

Thats safe. If you want your eth0 back, add
Code:
net.ifnames=0
to your kernel parameters in your boot loader.
_________________
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
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