ifconfig does not save

Hi, I do have a problem, when I am trying to configure ifconfig. [cmd=]ifconfig inet ip netmask netmask[/cmd]. After this, it works. If I do reboot my server, all those configurations reset (sorry, I don't know how to explain this), and my server is not connected anymore to the internet. Can you give me some advice?

Thanks.
 
Why would you think those settings are saved?

You need to edit /etc/rc.conf:
Code:
ifconfig_rl0="inet 1.2.3.4 netmask 255.255.255.0"
That's assuming the interface is rl(4).
 
I do have one last question (and yes, it did work, thanks for helping, @SirDice), where should I put the gateway?
 
Last edited by a moderator:
I did the command [CMD=""]ifconfig vr0 inet 192.168.1.10 netmask 255.255.255.0[/CMD], and here is what I got:
Code:
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=82808<VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:0a:e6:69:44:d8
        inet6 fe80::20a:e6ff:fe69:44d8%vr0 prefixlen 64 scopeid 0x5
        inet 192.168.1.10 netmask 0xffffff00 broadcast 192.168.1.255
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active

If I use [CMD=]ping http://www.google.com[/CMD], this error shows up:
Code:
[root@privat /]# ping www.google.com
ping: cannot resolve www.google.com: Host name lookup failure

Any help please?
 
/etc/rc.conf:
Code:
defaultrouter="192.168.1.1"
/etc/resolv.conf:
Code:
nameserver a.b.c.d
nameserver e.f.g.h
You can add as many nameservers as you'd like. These need to be IP addresses.
 
I know those must be IP addresses
Code:
 Generated by resolvconf
nameserver 193.231.100.130
nameserver 193.231.100.134
I did what you've said,
Code:
defaultrouter="192.168.1.1"
I rebooted my PC and now [cmd=]ping http://www.google.com[/cmd] works.But I still have a weird netmask and broadcast did change after reboot.Before it was 192.168.1.225, now it is 222.190.1.225
Code:
vr0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=82808<VLAN_MTU,WOL_UCAST,WOL_MAGIC,LINKSTATE>
        ether 00:0a:e6:69:44:d8
        inet 192.168.1.10 netmask 0xe1e1ff00 broadcast 222.190.1.255
        inet6 fe80::20a:e6ff:fe69:44d8%vr0 prefixlen 64 scopeid 0x5
        nd6 options=29<PERFORMNUD,IFDISABLED,AUTO_LINKLOCAL>
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
Is that normal?
 
How did you write the address in rc.conf? We can't offer help if you don't provide all the necessary information.
 
Here's rc.conf
Code:
hostname="privat"
ifconfig_vr0="YES"
sshd_enable="YES"
# Set dumpdev to "AUTO" to enable crash dumps, "NO" to disable
dumpdev="NO"
mysql_enable="YES"
ifconfig_vr0="inet 192.168.1.10 netmask 225.225.255.0"
defaultrouter="192.168.1.1"
 
Tosti said:
Code:
ifconfig_vr0="YES"

YES is not a valid value for an ifconfig setting. But this line will be ignored because it is overwritten by a value later in the file. Remove it.

Code:
ifconfig_vr0="inet 192.168.1.10 netmask [color="Red"]225[/color].[color="Red"]225[/color].255.0"

Those are likely typos and should be 255, not 225. Or just change to a simpler form:
Code:
ifconfig_vr0="inet 192.168.1.10/24"
 
Back
Top