Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[Solved] No networking on fresh install
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
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat May 11, 2013 5:23 pm    Post subject: [Solved] No networking on fresh install Reply with quote

Hi!
I have installed very basic (kernel, grub, mc, syslog) system. On first boot I can not access network.
Code:

# /etc/init.d/net.eth0 start
Bringing up interface eth0
* ERROR: interface eth0 does not exist
* Ensure that you have loaded the correct kernel module for your hardware
* ERROR: net.eth0 failed to start

Networking configured properly (static IP 192.168.1.3, netmask 255.255.255.0, gateway 192.168.1.1, nameserver 8.8.8.8 ).
lsmod shows my card module is loaded (r8169), dmesg output contains these strings:
Code:

[    6.428388] r8169 Gigabit Ethernet driver 2.3LK-NAPI loaded
[    6.428619] r8169 0000:04:00.0: irq 42 for MSI/MSI-X
[    6.428735] r8169 0000:04:00.0 eth0: RTL8168e/8111e at 0xffffc9000067a000, 1c:6f:65:42:be:2a, XID 0c200000 IRQ 42
[    6.428737] r8169 0000:04:00.0 eth0: jumbo features [frames: 9200 bytes, tx checksumming: ko]
[    6.432404] systemd-udevd[245]: renamed network interface eth0 to enp4s0


What the hell this systemd does here? Are we switched to systemd? What I have to do with this enp4s0?


Last edited by creaker on Sat May 11, 2013 11:01 pm; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


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

PostPosted: Sat May 11, 2013 5:34 pm    Post subject: Reply with quote

creaker,

you are another victim of predictable netinterface names (they are not predictable really, just confusing). There are many ways to skin this cat, adding net.ifnames=0 to your kernel command line is one of them.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat May 11, 2013 5:40 pm    Post subject: Reply with quote

creaker,

Its udev, not systemd. udev has been sucked into the systemd sources but Gentoo is keeping it separate meanwhile.

The udev upstream devs thought it would be a good idea to change the network interface default naming scheme from one that suits about 95% of use cases to another that suits about 95% of use cases and makes a mess for the 95% of users who didn't know or care that eth0 was a part of the default network naming scheme.

Change eth0 everywhere to enp4s0 and everything will work until the good idea fairy visits the udev upstream devs again, or you can read around the net about how to stop udev renaming things like this.
_________________
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: 8291
Location: Saint Amant, Acadiana

PostPosted: Sat May 11, 2013 5:50 pm    Post subject: Reply with quote

Quote:
Change eth0 everywhere to enp4s0 and everything will work until the good idea fairy visits the udev upstream devs again, or you can read around the net about how to stop udev renaming things like this.
:)
Actually even without fairy your enp4s0 can change unpredictably if it is a removable device. Like an add-on PCI card or USB network device. Just plug it into another PCI slot or USB port and you will get a brand new (un)predictable name.
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat May 11, 2013 6:23 pm    Post subject: Reply with quote

Thanks guys!

Kernel option "net.ifnames=0" works fine.

Renaming all the "eth0" to "enp4s0" works only till reboot. After reboot I have to start network by hand, even with "rc-update add /etc/init.d/net.enp4s0 default"
I renamed eth0 to enp4s0 in /etc/conf.d/net and did "mv /etc/init.d/net.eth0 /etc/init.d/net.enp4s0"
Did I forgot something else?
Back to top
View user's profile Send private message
NeddySeagoon
Administrator
Administrator


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

PostPosted: Sat May 11, 2013 6:38 pm    Post subject: Reply with quote

creaker,

The content of /etc/conf.d/net maybe?
_________________
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
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat May 11, 2013 7:05 pm    Post subject: Reply with quote

NeddySeagoon wrote:
creaker,

The content of /etc/conf.d/net maybe?


No.

/etc/conf.d/net:
Code:

dns_domain_lo="homenetwork"
config_enp4s0="192.168.1.3 netmask 255.255.255.0 brd 192.168.1.255"
routes_enp4s0="default via 192.168.1.1"


Code:
# ln -s /etc/init.d/net.lo /etc/init.d/net.enp4s0
ln: failed to create symbolic link '/etc/init.d/net.enp4s0' : File exists
# rc-update add net.enp4s0 default
 * rc-update: net.enp4s0 already installed in runlevel `default`; skipping


But still I have to start it yb hand after reboot.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat May 11, 2013 7:15 pm    Post subject: Reply with quote

It looks like eth0 still presented in system: dmesg still shows that udev renames eth0 to enp4s0:

Code:

[    6.186572] systemd-udevd[244]: renamed network interface eth0 to enp4s0
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21591

PostPosted: Sat May 11, 2013 9:31 pm    Post subject: Reply with quote

creaker wrote:
It looks like eth0 still presented in system: dmesg still shows that udev renames eth0 to enp4s0:

Code:

[    6.186572] systemd-udevd[244]: renamed network interface eth0 to enp4s0
This is normal. The kernel knows the correct name for your device is ethN and names it as such when the system initializes. The message you showed is logged when udev starts and renames it to what the udev maintainers want to call it.
Back to top
View user's profile Send private message
creaker
l33t
l33t


Joined: 14 Jul 2012
Posts: 651

PostPosted: Sat May 11, 2013 10:57 pm    Post subject: Reply with quote

Hu wrote:
creaker wrote:
It looks like eth0 still presented in system: dmesg still shows that udev renames eth0 to enp4s0:

Code:

[    6.186572] systemd-udevd[244]: renamed network interface eth0 to enp4s0
This is normal. The kernel knows the correct name for your device is ethN and names it as such when the system initializes. The message you showed is logged when udev starts and renames it to what the udev maintainers want to call it.


Yes, it is. But I can't get networking started on system boot.
I just reinstalled the system, remembering that the new name should be enp4s0 and configured network initially as enp4s0.
Now all works fine. May be previous installation has something related to eth0 and I failed to rid it out.

Thanks guys!
Back to top
View user's profile Send private message
MyKEcz
n00b
n00b


Joined: 12 May 2013
Posts: 2
Location: CZ

PostPosted: Sun May 12, 2013 12:55 pm    Post subject: Reply with quote

Hi guys,
I'm new to gentoo and I have followed gentoo guide and everything works except eth0.

I have compiled build-in-kernel drivers for Intel PRO/1000MT Desktop (82540EM), it's for Virtualbox and still doesn't work.

Here is image: http://sdrv.ms/YOrCL9
Code:

ERROR: interface eth0 does not exist
Ensure that you have loaded the correct kernel module for your hardware
ERROR: net.eth0 failed to start
ERROR: cannot start netmount as net.eth0 would not start

I followed http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=1&chap=3

So I want to have DHCP enabled, I haven't configured any IP address, only domain name...

I have tried to search this problem and few topics which I found doesn't solved my problem
Thank you for ideas.

EDIT: i tried to run ls /sys/class/net and there are only two items - lo; enp0s3 but no eth0 - maybe this is reason why it doesn't work?
Back to top
View user's profile Send private message
SamuliSuominen
Retired Dev
Retired Dev


Joined: 30 Sep 2005
Posts: 2133
Location: Finland

PostPosted: Sun May 12, 2013 1:43 pm    Post subject: Reply with quote

MyKEcz wrote:

EDIT: i tried to run ls /sys/class/net and there are only two items - lo; enp0s3 but no eth0 - maybe this is reason why it doesn't work?


Your interface is called enp0s3 instead of eth0, so simply use enp0s3 everywhere instead of eth0, like net.enp0s3 symlink in /etc/init.d

More information in the handbook, http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=4&chap=2#doc_chap4
Back to top
View user's profile Send private message
MyKEcz
n00b
n00b


Joined: 12 May 2013
Posts: 2
Location: CZ

PostPosted: Sun May 12, 2013 2:42 pm    Post subject: Reply with quote

ssuominen wrote:
MyKEcz wrote:

EDIT: i tried to run ls /sys/class/net and there are only two items - lo; enp0s3 but no eth0 - maybe this is reason why it doesn't work?


Your interface is called enp0s3 instead of eth0, so simply use enp0s3 everywhere instead of eth0, like net.enp0s3 symlink in /etc/init.d

More information in the handbook, http://www.gentoo.org/doc/en/handbook/handbook-amd64.xml?part=4&chap=2#doc_chap4


Solved, thank you for help :)
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21591

PostPosted: Sun May 12, 2013 4:43 pm    Post subject: Reply with quote

MyKEcz wrote:
EDIT: i tried to run ls /sys/class/net and there are only two items - lo; enp0s3 but no eth0 - maybe this is reason why it doesn't work?
Correct. sys-apps/udev "helpfully" renamed your interface so that the instructions in the handbook did not work.
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