netserver on jail but netperf can't see it

I am trying to perform efficiency and performance tests on a network scheme I have. The network scheme has jails with dedicated services and protected by firewalls.

I have installed netperf on my host machine. But I'm trying to do netperf from host to jail or from jail to host. So from the Host I type:
# netperf -H jailIP

But I get the following message:
Code:
establish control: are you sure there is a netserver listening on 192.168.1.2 at port 12865?
establish_control could not establish control connection from 0.0.0.0 port 0 address family 
AF_UNSPEC to 192.168.1.2 port 12865 address family AF_UNSPEC

netperf on the host machine on the localhost works with the 10 second test.
netperf on the jail on the localhost does not work and returns the same message.

I have mounted /usr/local/bin in the jail's path, and I have confirmed that both /usr/local/bin/netperf and /usr/local/bin/netserver exist in the jail. I have modified the lines in /etc/services to include the following
Code:
netperf 12865/tcp
and /etc/inetd.conf
Code:
netperf stream tcp nowait root /usr/local/bin/netserver netserver
I have restarted inted in the jail. I have restarted the jails. I still get the establish control message.

What seems to be the problem?
 
You need to make sure inetd is bound to the jail's IP address instead of all (*) IP addresses.
 
I'm not sure if this is the correct way of doing it but inside the jail I did:

Code:
/etc/rc.d/inetd stop
inetd -a 192.168.1.2
netperf

it gave me the same message about establish control. 192.168.1.2 is the jail IP address.
 
Make sure there are no other inetd listening on * on the other jails (and the host) too.
 
I have stopped inetd on the other jails and the host and only kept inetd -a jailip on the jail in question. I still get the same message.
 
I can't do netstat within the jail. I get kvm device not available.

I played around with it, not really sure what I changed really but now, when I stop inetd and start it again, I get the following message:
Code:
TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to localhost (::1) port 0 AF_INET6
netperf: send_tcp_stream: data socket connect failed: Invalid argument

whereas when i stop inetd and start it with -a jailip option, I get the message I mentioned in my first post.
 
I fixed it as follows:

Remove everything I've added for in /etc/services and /etc/inetd.conf for netperf. Then on jail machine, start netserver with this command:
# netserver -L 192.168.1.2 -p 12865 -4

on host machine, start netperf normally
# netperf -H 192.168.1.2

192.168.1.2 is the jail's IP.
 
Back
Top