Get network/interface traffic from within jail

I have bought a tiny FreeBSD VPS. It appears be running 8.3-STABLE (from uname -or) and, from the advertising and from sysctl security.jail.jailed giving 1, I assume it is running within a jail.

Because it is a tiny VPS, there is no support, so I can't open a ticket to do things like request different sysctl parameters on the host.

I would like to record the daily external traffic so I can check on my monthly quota usage. I have tried these methods to show traffic through an interface, with no success:
Code:
# ifconfig -a          # show interfaces
re0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8209b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,WOL_MAGIC,LINKSTATE>
     ...etc...
ipfw0: flags=8801<UP,SIMPLEX,MULTICAST> metric 0 mtu 65536
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        options=3<RXCSUM,TXCSUM>


# netstat -i -n -n -I re0      # same output happens for interface ipfw0
netstat: kvm not available: /dev/mem: No such file or directory
ifnet: symbol not defined


#                      # try using a pipe in the firewall to record statistics
# ipfw add 1 pipe tcp from any to any
# ipfw add 1 pipe udp from any to any
# ipfw add 1 pipe ip from any to any
# ipfw pipe 1 config mask all
ipfw: setsockopt(IP_DUMMYNET_CONFIGURE): Protocol not available


# ipfstat -t -6C
open(IPSTATE_NAME): No such file or directory

I'm now stumped. Is there a way to get this info from within a jail?

Thanks,
Nick (very experienced on Linux, some on OpenBSD, none from within a jail)
 
You can't do anything you want to do within a jail. I would suggest another VPS provider, one that supplies a complete VPS instead of just a jail.

Mine only costs about 13 euro a month.
 
Back
Top