static ip in rc.conf

Post your general questions or comments about GhostBSD here!
Post Reply
jjrushford
Posts: 3
Joined: Sun Feb 12, 2023 8:54 pm

static ip in rc.conf

Post by jjrushford »

Greetings,

I'm a long time FreeBSD user and decided to try GhostBSD. For some reason, I cannot set a static IP in rc.conf. I'm using in rc.conf:

ifconfig_bge0="inet 192.168.1.50 netmask 0xffffff00"
defaultrouter="192.168.1.1"

When I boot, neither the IP address and netmask are set on bge0, I have to manually set them in the terminal. Also, the default route isn't set. What's going on in GhostBSD?
RodMyers
Posts: 67
Joined: Sat Nov 27, 2021 8:16 pm

Re: static ip in rc.conf

Post by RodMyers »

Doesn't answer your question directly. I have things setup using DHCP, and run a script when I am home to set a static IP;

cat bin/01_init.sh
#!/bin/sh

sudo ifconfig wlan0 inet 192.168.1.28 netmask 255.255.255.0
sudo route delete default ; sudo route add default 192.168.1.254



Nor perfect, but .............

I also posted the link to this query inside the telegram channel
jjrushford
Posts: 3
Joined: Sun Feb 12, 2023 8:54 pm

Re: static ip in rc.conf

Post by jjrushford »

I just don't understand why my rc.conf settings aren't working. I've looked through the documentation and as far as I can see, GhostBSD uses /etc/rc.conf.
nevets
Posts: 149
Joined: Tue Jun 23, 2020 3:54 am

Re: static ip in rc.conf

Post by nevets »

You might try the utility in FreeBSD.
# sudo bsdconfig networking
It's one of the tools installed by default.
It will write to the conf files.
... Not sure if the start-up app networkmgr conflicts...
jjrushford
Posts: 3
Joined: Sun Feb 12, 2023 8:54 pm

Re: static ip in rc.conf

Post by jjrushford »

yeah I tried bsdconfig and it wrote the same lines in rc.conf that I did by hand and the network interface is not getting configured during boot up
aschiebe
Posts: 30
Joined: Sat Mar 14, 2020 4:04 pm

Re: static ip in rc.conf

Post by aschiebe »

Hi all,
these settings are working on my devices
---
/etc/rc.conf
---
ifconfig_bge0="inet 10.200.5.29 netmask 255.255.255.0"
defaultrouter="10.200.5.250"
---
are you sure that your adapter is beg0 or maybe another like em0 ?
and
why are you using these strange chars for your netmask value?
---
do you have maybe a 2nd entry for ifconfig in your rc.conf file?
---
just trying to give an example that works on my devices.
Regards Arnold
Post Reply