Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Systemd no internet connection
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
gromber
n00b
n00b


Joined: 14 Jun 2021
Posts: 5

PostPosted: Tue Jun 15, 2021 3:56 pm    Post subject: Systemd no internet connection Reply with quote

Systemd no internet

I have a systemd intallation and i have followed the systemd net setup guide so i created the file in the networkd directory for a dhcp connection and i have enabled the service. I have also created the symlink for dns and i also enabled that. I still do not have internet. Ip a shows my lan state is UP but still nothing. If i remember correctly i also installed dhcpcd. I have also created a symlink in init.d for the net interfaces since at first i didnt realise that that is for openrc only. How can i delete those symlinks? Will it break anything if i do? Do i need to do something else for the network to work?
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3875

PostPosted: Tue Jun 15, 2021 4:53 pm    Post subject: Reply with quote

Hi i hope you have a file like
/etc/systemd/network/eth0.network
Code:

### for dhcp
[Match]
Name=eth0

[Network]
DHCP=yes

###for static
[Match]
Name=eth0

[Network]
Address=10.1.10.9/24
Gateway=10.1.10.1
DNS=10.1.10.1

Either use dhcp or static.
And comment out the other.
What is the name of your iface?
Please Do NOT manually create any symlinks.
Code:

emerge -av dhcpcd
rm /etc/resolv.conf
echo "nameserver  8.8.8.8" > /etc/resolv.conf
systemctl enable --now dhcpcd
systemctl enable --now systemd-networkd




If it doesnt work with dhcp use static.
Can you bring up your iface?
Code:

ip link set <iface> up
ip a


If not you miss kernel .config
Code:

lspci -v

I am not sure if Gentoo implementation of systemd has also systemd-resolved or no.

Quote:

i created the file in the networkd directory

The directory should be
Code:

/etc/systemd/network

NOT "networkd"
_________________
:)
Back to top
View user's profile Send private message
gromber
n00b
n00b


Joined: 14 Jun 2021
Posts: 5

PostPosted: Tue Jun 15, 2021 5:20 pm    Post subject: Reply with quote

Well ip a has my ethernet interface named ens60u1 or something like that but i use a usb to rj45 adapter. The interface gets renamed to eth0 so im not sure which one to put there. Yes i have that file although only the dhcp part. One more question, about the *nameserver*; is that literal or what should that name be?
Back to top
View user's profile Send private message
gromber
n00b
n00b


Joined: 14 Jun 2021
Posts: 5

PostPosted: Tue Jun 15, 2021 5:25 pm    Post subject: Reply with quote

Sorry, my mistake on the nameserver, i didnt see the quotation marks. I get it now
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3875

PostPosted: Tue Jun 15, 2021 5:34 pm    Post subject: Reply with quote

Please get rid of the obnoxious enp0hhuhhuhu naming.
I know its very confusing
In
/etc/default/grub
please
Code:

GRUB_CMDLINE_LINUX="................  net.ifnames=0 biosdevname=0"
grub-mkconfig -o /boot/grub/grub.cfg
reboot

You will now have eth0 and eth1
If you need both create two files in
/etc/systemd.network
one et0.network and another eth1.network
NOT BOTH DHCP
Keep eth1 static WITHOUT assigning any "Gateway="

Have i understood correctly?
You have 2 ethernet ifaces no?
_________________
:)
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