Page 1 of 1
static ip in rc.conf
Posted: Sun Feb 12, 2023 9:42 pm
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?
Re: static ip in rc.conf
Posted: Sun Feb 12, 2023 10:17 pm
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
Re: static ip in rc.conf
Posted: Sun Feb 12, 2023 10:27 pm
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.
Re: static ip in rc.conf
Posted: Mon Feb 13, 2023 5:07 pm
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...
Re: static ip in rc.conf
Posted: Tue Feb 14, 2023 12:27 am
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
Re: static ip in rc.conf
Posted: Tue Mar 14, 2023 5:35 pm
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