# defaultrouter defined in rc.conf not working



## LRHS (Mar 5, 2010)

Hi everyone,

I am running freebsd 8 (and I am pretty new at it)
Currently my box is setup as a bridge running PF, Squid and Dansgaurdian. Everything works great, except I can't seem to get my default gateway to stick despite modifying the rc.conf file and adding defaultrouter="10.0.0.1" 

After reboot I have to do a route add 0.0.0.0 10.0.0.1 command and all works.


Any ideas???

Thank you!

dave


----------



## Alt (Mar 5, 2010)

typo in rc.conf ?


----------



## Time2IPL (Mar 5, 2010)

LRHS said:
			
		

> ...
> After reboot I have to do a route add 0.0.0.0 10.0.0.1 command and all works.
> ...



What do "netstat -rn" and "ifconfig" show prior to the manual addition of the default route?

- Larry


----------



## LRHS (Mar 8, 2010)

Hi,

Here is ifconfig output:


```
bge0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=98<VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM>
        ether 00:12:3f:53:bf:5a
        media: Ethernet autoselect (100baseTX <half-duplex>)
        status: active
vx0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:a0:24:bd:b2:b0
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000
bridge0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 76:21:34:6f:6a:17
        inet 10.0.0.25 netmask 0xffff0000 broadcast 10.0.255.255
        id 00:00:00:00:00:00 priority 32768 hellotime 2 fwddelay 15
        maxage 20 holdcnt 6 proto rstp maxaddr 100 timeout 1200
        root id 00:00:00:00:00:00 priority 32768 ifcost 0 port 0
        member: bge0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 1 priority 128 path cost 55
        member: vx0 flags=143<LEARNING,DISCOVER,AUTOEDGE,AUTOPTP>
                ifmaxaddr 0 port 2 priority 128 path cost 2000000
```


netstat -rn


```
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
10.0.0.0/16        link#5             U           2       64 bridge
10.0.0.25          link#5             UHS         0        0    lo0
127.0.0.1          link#4             UH          0       74    lo0

Internet6:
Destination                       Gateway                       Flags      Netif Expire
::1                               ::1                           UH          lo0
fe80::%lo0/64                     link#4                        U           lo0
fe80::1%lo0                       link#4                        UHS         lo0
ff01:4::/32                       fe80::1%lo0                   U           lo0
ff02::%lo0/32                     fe80::1%lo0                   U           lo0
```


AND rc.conf



```
# -- sysinstall generated deltas -- # Thu Feb 18 08:18:28 2010
# Created: Thu Feb 18 08:18:28 2010
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
gateway_enable="YES"
pf_enable="YES"
pf_rules="/etc/pf.conf"
pf_log="YES"
#webmin_enable="YES"
defaultrouter="10.0.0.1"
cloned_interfaces="bridge0"
ifconfig_bridge0="addm vx0 addm bge0 up"
ifconfig_vx0="up"
ifconfig_bge0="up"
ifconfig bridge0 inet 10.0.0.25/16

sshd_enable="YES"
squid_enable="YES"
```
Thanks!

-d


----------



## DutchDaemon (Mar 8, 2010)

This shouldn't be in rc.conf like that:


```
ifconfig bridge0 inet 10.0.0.25/16
```

Try


```
ifconfig_bridge0_alias0="inet 10.0.0.25/16"
```


----------



## SirDice (Mar 8, 2010)

Remove the bridge.


----------



## LRHS (Mar 8, 2010)

*Thanks guys*

Thanks Dutchdaemon!

-d


----------

