# default route in jail's rc.conf not taken into account



## lalebarde (May 2, 2013)

Hi all,

I am testing vnet jails. Although I have defined a default route in the jail's /etc/rc.conf, it is not set up at boot:


```
root@jail02:/root # netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
10.7.100.0/24      link#2             U           0        9  vnet0
10.7.100.2         link#2             UHS         0        2    lo0
127.0.0.1          link#1             UH          0        2    lo0
```


```
root@jail02:/root # cat /etc/rc.conf | sed -e 's/#.*//;/^\s*$/d'
defaultrouter="10.7.100.254"
pf_enable="NO"
rpcbind_enable="NO"
cron_flags="$cron_flags -J 15"
syslogd_flags="-ss"
sendmail_enable="NO"
sendmail_submit_enable="NO"
sendmail_outbound_enable="NO"
sendmail_msp_queue_enable="NO"
```

If I perform one of the two following actions, it works:



```
root@jail02:/root # route add default 10.7.100.254
```



```
root@jail02:/root # service routing start
add net default: gateway 10.7.100.254
sysctl: net.inet.ip.sourceroute: Operation not permitted
sysctl: net.inet.ip.accept_sourceroute: Operation not permitted
add net ::ffff:0.0.0.0: gateway ::1
add net ::0.0.0.0: gateway ::1
add net fe80::: gateway ::1
add net ff02::: gateway ::1
```


So, it seems that routing is not started at boot time. Adding 
	
	



```
routing_enable="YES"
```
 in /etc/rc.conf does not help. I have looked for it but have not managed to find the solution. 

Any help please?


----------



## fbsd1 (Jun 9, 2013)

Your VNET jails are being effected by a long time known bug. See PR PR 149050.

Workaround: issue these commands in this order from inside of the jail before /etc/rc gets executed at jail startup{
`service netif start`
`service routing start`


----------

