Routing from the Jail...

Status
Not open for further replies.

[XAP]Bob

Dabbler
Joined
Jan 6, 2013
Messages
21
I have the following setup:

x.x.x.x/24:
1)Linux server - OpenVPN endpoint (amongst other things)
2)FreeNAS
111) FreeNAS jail (Transmission)

y.y.y.y/24:
1)Linux box - OpenVPN endpoint (amongst other things)

z.z.z.z/24:
Various (including OpenVPN endpoint)

pu.bl.ic.ip:
Linux server: including OpenVPN server - combining all the above networks, not as a default route though.


From within x.x.x.x/24 I can happily talk to Transmission - but not over the VPN. Transmission can connect to the world, so at least some routing is happening.


How can I see/edit the routing table in the jail to include routes to y.y.y.y/24 and z.z.z.z/24 via x.x.x.1?

Doing a little reading I tried:

# jexec 1 ifconfig -a
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=3<RXCSUM,TXCSUM>
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1
nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
epair0b: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8<VLAN_MTU>
ether 02:80:c4:00:0a:0b
inet x.x.x.111 netmask 0xffffff00 broadcast x.x.x.255
inet6 fe80::80:c4ff:fe00:a0b%epair0b prefixlen 64 scopeid 0x2
nd6 options=3<PERFORMNUD,ACCEPT_RTADV>
media: Ethernet 10Gbase-T (10Gbase-T <full-duplex>)
status: active

# jexec 1 netstat -rn
netstat: kvm not available: /dev/mem: No such file or directory
Routing tables
rt_tables: symbol not in namelist


A brief google suggests that this might require kernel parameter changes - at which point I've decided to leave well alone until I've had some real advice...
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
You can just run route command within the jail:

# jexec 1 route add -net y.y.y.y/24 x.x.x.1

However you cannot see the route table for the jail unless you change devfs to unhide /dev/mem to the jail.

I believe this kernel paramter you mentioned is the ROUTETABLES to use with setfib? Yeah, thats not available yet for freenas.
 

[XAP]Bob

Dabbler
Joined
Jan 6, 2013
Messages
21
Thanks,

I've added those successfully :)

Would that be persistent?
If not is there somewhere in the jail I can add that to ensure that they get added when the jail is started?
 

William Grzybowski

Wizard
iXsystems
Joined
May 27, 2011
Messages
1,754
I think you could just add them in the /etc/rc.conf within the jail usin proper syntax, or just /etc/rc.local
 

[XAP]Bob

Dabbler
Joined
Jan 6, 2013
Messages
21
Thanks - I shall read through the rc options for BSD (then post back if I get it working)

From: http://www.freebsd.org/cgi/man.cgi?query=rc.conf&sektion=5
static_routes
(str) Set to the list of static routes that are to be added
at system boot time. If not set to ``NO'' then for each
whitespace separated element in the value, a route_<element>
variable is assumed to exist whose contents will later be
passed to a ``route add'' operation. For example:

static_routes="mcast gif0local"
route_mcast="-net 224.0.0.0/4 -iface gif0"
route_gif0local="-host 169.254.1.1 -iface lo0"

Looks appropriate...

I've added into it - we'll see what happens when the jail next restarts. Thanks.
 
Status
Not open for further replies.
Top