Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
allow incoming connections without netfirc [SOLVED]
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
spykyvenator
n00b
n00b


Joined: 31 May 2022
Posts: 23

PostPosted: Sat Jan 13, 2024 7:44 pm    Post subject: allow incoming connections without netfirc [SOLVED] Reply with quote

Hey,

I recently switched from init system to sinit, and removed netifrc from my openrc use flags to make it lighter.
However, at the moment my pc no longer accepts incomming connections, for example when I try to mount my nfs drive, ssh or host a xonotic lan match no one can connect to the server.

This is because of netifrc, I just reinstalled this and did a reboot and tested ssh.

How can I make this work without netifrc?

I would like to replace openrc with a different service manager and would like to know how to set this up.

/etc/init.d/net.lo is quite lenghty and as far as I can tell my /etc/conf.d/net does the same as my startup script:
Code:
config_enp4s0="192.168.0.248 broadcast 192.168.0.255 netmask 255.255.255.0"
routes_enp4s0="default via 192.168.0.1"


vs

Code:
ip link set enp4s0 up
ip route add 192.168.0.1 dev enp4s0
ip route add default via 192.168.0.1 dev enp4s0
ip a add 192.168.0.248 dev enp4s0


I of course also roamed the web some, but found no answer.

Thanks in advance.


Last edited by spykyvenator on Sat Jan 13, 2024 8:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 932
Location: Richmond Hill, Canada

PostPosted: Sat Jan 13, 2024 8:03 pm    Post subject: Reply with quote

I am not familiar to sinit and from online reading it is not clear how it call service script. So can you give some idea how your network script got called?

Since sinit just a simple init program with minimal features I see no conflict with netifrc, why not setup sinit call netiffc to start network interface? I know you wish to not use netifrc, this question is just help me to understand where the difference in your approach. since I see no information on service dependency so I wonder if it possible that interface was brought up later than network services. So therefor nothing can listen for request.
Back to top
View user's profile Send private message
krumpf
Apprentice
Apprentice


Joined: 15 Jul 2018
Posts: 175

PostPosted: Sat Jan 13, 2024 8:06 pm    Post subject: Reply with quote

Not sure if it's what you're looking for, but maybe it'll give you some hints/ideas : https://wiki.gentoo.org/wiki/Network_management_using_DHCPCD
Back to top
View user's profile Send private message
spykyvenator
n00b
n00b


Joined: 31 May 2022
Posts: 23

PostPosted: Sat Jan 13, 2024 8:24 pm    Post subject: Reply with quote

So sinit runs a simple bash script in /bin/rc.init that performs all of openrc's duties (like starting dhcpd, mounting filesystems etc)

I didn't think about simply calling netifrc :D , thanks for pointing that out. Instead at the moment I have
Code:
RUNLEVEL=S /sbin/openrc sysinit
RUNLEVEL=S /sbin/openrc boot


which then starts netifrc.

I will try that, but I am still curious if this can be done with something like iproute (the ip command).
Back to top
View user's profile Send private message
pingtoo
l33t
l33t


Joined: 10 Sep 2021
Posts: 932
Location: Richmond Hill, Canada

PostPosted: Sat Jan 13, 2024 8:43 pm    Post subject: Reply with quote

spykyvenator wrote:
So sinit runs a simple bash script in /bin/rc.init that performs all of openrc's duties (like starting dhcpd, mounting filesystems etc)

I didn't think about simply calling netifrc :D , thanks for pointing that out. Instead at the moment I have
Code:
RUNLEVEL=S /sbin/openrc sysinit
RUNLEVEL=S /sbin/openrc boot


which then starts netifrc.

I will try that, but I am still curious if this can be done with something like iproute (the ip command).


I think if you have log the execution sequence than it will be easier to find out what happen when your iproute commands.

netifrc just fancy way calling iproute. so if you want to simple approach I think it is doable, but you miss all the accumulated experience in netifrc. so if there is some condition that require special handle of network interface start up you will need to handle you self in your script. for example may be there some sort of timing issue for kernel to see the device or may be you need to load modules first.
Back to top
View user's profile Send private message
spykyvenator
n00b
n00b


Joined: 31 May 2022
Posts: 23

PostPosted: Sat Jan 13, 2024 8:49 pm    Post subject: Reply with quote

For people reading this, I just found out with
Code:
rc-service "[service]" start -d
you get the log of all commands ran to start the service.
this can be redirected by appending
Code:
 > ./file >2&1
to the command for analyzing.

I will look into that later, thank you for the help pingtoo!

I will add [SOLVED] to the thread subject
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