Rc.conf setting are lost after netif restart

Hello,

I've installed freebsd on virtualbox. I configured the network settings and default route on it. But after I do a machine restart or I just restart /etc/rc.d/netif restart. The default route and ip address assigned to the interface gets erased. Please help, what could be causing this.
 
Have you removed the install CD image so the VM doesn't boot from that every time?
Please show the exact changes you made, and to which file.
Is the VM disk image set to be immutable?
 
wblock@ said:
Have you removed the install CD image so the VM doesn't boot from that every time?
Please show the exact changes you made, and to which file.
Is the VM disk image set to be immutable?

Hi,

So I'm booting from harddisk, rest of the other settings are saved
I assign IP:

Code:
ifconfig em0 192.168.1.10/24
route add default 192.168.1.1

When I do /etc/rc.d/netif restart, all the settings are gone....
 
I also tried to add entry under /etc/rc.conf

Code:
ifconfig_em0="inet 192.168.1.10 netmask 255.255.255.0"
### Default gateway ###
defaultrouter="192.168.1.10"

but same result once I execute /etc/rc.d/netif restart setting is gone.
 
It would help to see the rest of /etc/rc.conf. My guess is that you have a DHCP entry after the static IP entries.
 
Hi, Please mark this post as solved. The issue is resolved, I restarted the system again it started working...
 
/etc/rc.d/netif only restarts the interface. In doing so it will remove the default gateway. You need to restart /etc/rc.d/routing too.
 
Back
Top