Re: [gentoo-user] Handbook and question about manual network setup

2024-04-22 Thread Dale
Michael wrote:
> Hi Dale,
>
> On Sunday, 21 April 2024 03:32:32 BST Dale wrote:
>
>> OK.  I did my weekend OS updates on my main rig, fireball.  That
>> involves me switching to boot runlevel and back again.  When the network
>> started, no message about going to default.  It just showed it starting
>> up and using DHCP.   Looks like this: 
>>
>>
>>  * Bringing up interface enp3s0
>>  *   dhcp ...
>>  * Running dhcpcd ...
>>
>>
>>
>> I thought of something.  My NAS box is shutdown right now so can't
>> check.  I bet DHCP is set to start in the default runlevel.  On my main
>> rig it is not set to start the DHCP service at all.  I suspect the NAS
>> box finds the DHCP service first and starts the network and then finds
>> the network service but it is already started.  When it starts the
>> network with the DHCP service, it does the default thing.  I'll test
>> that next time I boot up the NAS box. 
> On one box here I have neither netifrc configured, nor dhcpcd, although both 
> are installed.  I have also made sure networkmanager is not installed.
>
> However, netmount is in the default runlevel and netmount has the default net 
> dependency enabled:
>
> $ grep -v "^#" /etc/conf.d/netmount
> rc_need="net"
>
> $ rc-update show -v | grep -i net
> local |  default nonetwork 
>net-online |
>net.lo |
>  netmount |  default
>
> I believe this is what kicks in on my system first and brings up dhcpcd, 
> which 
> in turn obtains an IP address from my router.  I mostly configure static IP 
> addresses for known devices in my LAN on the router.
>
> You can compare which network services are configured to come up on your NAS 
> Vs your main PC and also check any differences in /etc/rc.conf.  Finally 
> search for "rc_need=" dependencies defined in your /etc/conf.d/*.
>
> https://wiki.gentoo.org/wiki/OpenRC#Dependency_behavior
>
>
>> I guess no one else found a way to get the install handbook on a single
>> page.  I'll have to copy and paste I guess.  That's gonna take a while. 
>> O_O 
>>
>> Dale
>>
>> :-)  :-) 
> To save you copying:
>
> https://wiki.gentoo.org/wiki/Handbook:AMD64/Full/Installation
>
> but note the warning about links redirecting to individual pages:
>
> https://wiki.gentoo.org/wiki/Handbook:AMD64/Full


My thought was right.  My main rig does not have dhcpcd in any
runlevel.  I booted up the NAS box and checked to see if dhcpcd was
listed anywhere.  Sure enough, it was in the default runlevel.  I
removed it and then rebooted.  There was no mention of defaulting to
anything, the network just came up.  So, I guess dhcpcd was trying to
start the network first which means it never really saw any of the
config files I was adding info too.  It was starting before those came
into the picture.  So, now both rigs work the same and I can
start/stop/restart the network on both machines the same way. 

I suspect if I edited some dhcp config file and set up the ethernet the
proper way, it would just come up like it does now, after the change. 
Also, nothing against dhcp on my part.  My main rig uses it.  I wanted
the NAS box to use it as well, just the same as my main rig.  It works
great, even if one doesn't do anything to it.  Having it set up tho does
give more consistent results, as in the same IP address.  I can't recall
the last time I had dhcp to fail actually. 

Thanks for the links on the full docs on one page.  I already copy and
pasted it to a LOo doc and am editing out parts I won't ever use.  It's
116 pages and I'm sure there are parts in there that won't ever apply to
me, systemd for example.  Maybe I can get the page count down to 100 or
so.  If I'm lucky. 

Is there anyway to know when the doc changes and what changes?  And how
did you find that link?  I looked everywhere.  :/

Dale

:-)  :-) 


Re: [gentoo-user] Handbook and question about manual network setup

2024-04-22 Thread Michael
On Sunday, 21 April 2024 20:36:56 BST J. Roeleveld wrote:
> On Friday, 19 April 2024 16:05:47 CEST Dale wrote:
> > Howdy,
> > 
> > I'm playing around with my NAS box again.  I ran into a network issue.
> > I sorta forgot I unplugged the network cable so obviously, it made it
> > difficult to ssh into the thing from my main rig.  After hooking up a
> > monitor and keyboard, I found the problem and plugged the network cable
> > back in.  ROFLMBO  Told y'all I forget stuff.
> > 
> > Anyway, while investigating this, I realized the network setup is not
> > like on my old rig.  Heck, I couldn't even figure out how to restart it
> > other than switching to the boot runlevel and back to default, or
> > rebooting.  After a bit, I think I can restart DHCP and it restart the
> > network.  I figured out the cable was unplugged before trying that.  I'm
> > wanting to set up the NAS box network the same way as my main rig.
> > That's the old manual way.  I went back to the install handbook, that's
> > what I followed when installing on my main rig.  Thing is, it has been
> > updated and the old way isn't all there.  I followed what little bit is
> > there but it defaults back to the new way.  I'm sure I'm missing some
> > file I need to edit but I can't figure out which one it is.  So, is
> > there a way to get the old instructions again?  The ones I followed
> > several years ago for my main rig?  I tried searching but it seems they
> > all gone.  Maybe there is a place I'm not aware of tho.  Basically, I
> > want to be able to start/stop/restart enp3s0 as a service and have it in
> > a runlevel.
> > 
> > Also, I'd like to get the install handbook as one large page.  My
> > intention is to save it locally for future reference as it is now.  I
> > may even print a copy.  I looked at all the places that have different
> > options but can't find the whole thing as one large page.  I looked
> > under several drop down menus and such.  A long time ago, it was a
> > option.  I just can't find it now.  May that option isn't available
> > anymore.  I wish I had a copy of the one from several years ago.  Back
> > when I installed on my main rig.
> > 
> > Some network info.  Lines that are commented out are options I tried but
> > didn't work.  It was worth a shot.  o_O
> > 
> > 
> > nas / # grep -r '!net' /etc/
> > /etc/rc.conf:rc_hotplug="!net.*"
> > nas / # grep -r 'enp3s0' /etc/
> > /etc/resolv.conf:# Generated by dhcpcd from enp3s0.dhcp
> > /etc/conf.d/net:config_enp3s0="dhcp"
> > /etc/conf.d/net:dns_servers_enp3s0="8.8.8.8 8.8.4.4"
> > /etc/conf.d/net:#config_enp3s0="10.0.0.5"
> > nas / #nas / # ifconfig -s enp3s0
> > Iface  MTURX-OK RX-ERR RX-DRP RX-OVRTX-OK TX-ERR TX-DRP
> > TX-OVR Flg
> > enp3s0   150016802  0  0 0 17196  0
> > 0  0 BMRU
> > nas / #
> > 
> > 
> > Thoughts?  If I had the old install info, I think I could get it to
> > work.  I did last time.  ;-)
> 
> Yes, try:
> config_enp3s0="10.0.0.5/24"
> routes_enp3s0="default gw "
> 
> Changes to what I see:
> 1) You forgot the netmask ( /24 ) for the network
> 2) I don't see a default route
> 
> --
> Joost

That'll certainly work to specify a static IP address on the PC, but I 
understood Dale wanted to use DHCP to obtain an IP dynamically from the router 
and only use netifrc to set up DNS resolvers.

signature.asc
Description: This is a digitally signed message part.