Anders Bostrom wrote:
> Hi all,
>
> I'm trying to get a inetd controlled service to bind to a specific IP 
> address. Reason is that I wan't to have two different services on one 
> machine, listening on same port number, but on different logical interfaces.
>
> I have created a simple service myself and tested without any success and I 
> have tried to manipulate native ftp and telnet services without any luck as 
> well.
>
> What I do is,
> inetadm -m 'service' bind_addr='IP_address' (replace 'xxx' with the actual as,
> inetadm -m ftp bind_addr=192.168.0.100)
> (I can see with inetadm -l that the changes are accepted by the system, as 
> well as with svccfg)
>
> I have restarted inetd service, the actual service, rebooted (you name 
> it....) and I still always get *.'port' output from "netstat -an|grep 
> LISTEN". (example *.ftp), where I would expect something like 
> '192.168.0.100.ftp .... LISTEN'
>
>   
> I saw one posting in some other forum that someone had made this change for 
> telnet without any problem, but when I test with telnet, ftp or my own 
> "service" I always have the service responding on any IP address defined on 
> the machine. I have tested on several Solaris 10 machines with same result.
>
>   
Can you give a pointer to that post? It'd be interesting to see how 
others to this.
> My own service I created simply by adding the following to inetd.conf,
> "redirect stream tcp nowait root /usr/local/bin/redirect.sh redirect", 
> followed by "inetconv". The service "redirect" also is defined in 
> /etc/services as "redirect 9001/tcp".
>
> My service is working as I can do "telnet localhost 9001" and get correct 
> respons, but as I said before, the problem I have is the same also for native 
> services as ftp and telnet.
>
> Anybody having any ideas of what to change to get this working???? I feel I 
> have tested all svc* and inet* commands and searched manuals and on Internet 
> (and on Sunsolve), but no hints found anywhere.
>
>   
I did a quick experiment to clone the default ftp(see the attached 
script). Then I bind the second ftp instance to a specific IP address 
and that seems to work fine.

-tony

bash-3.00# svcs -l ftp
fmri         svc:/network/ftp:ftp-tony
name         FTP server
enabled      true
state        online
next_state   none
state_time   Thu Feb 15 10:32:38 2007
restarter    svc:/network/inetd:default
contract_id 

fmri         svc:/network/ftp:default
name         FTP server
enabled      true
state        online
next_state   none
state_time   Wed Feb 14 15:56:04 2007
restarter    svc:/network/inetd:default
contract_id 
bash-3.00# inetadm -l ftp-tony
SCOPE    NAME=VALUE
         name="ftp"
         endpoint_type="stream"
         proto="tcp6"
         isrpc=FALSE
         wait=FALSE
         exec="/usr/sbin/in.ftpd -a"
         user="root"
         bind_addr="172.20.48.107"
default  bind_fail_max=-1
default  bind_fail_interval=-1
default  max_con_rate=-1
default  max_copies=-1
default  con_rate_offline=-1
default  failrate_cnt=40
default  failrate_interval=60
default  inherit_env=TRUE
default  tcp_trace=FALSE
default  tcp_wrappers=FALSE
bash-3.00# inetadm -l ftp:default
SCOPE    NAME=VALUE
         name="ftp"
         endpoint_type="stream"
         proto="tcp6"
         isrpc=FALSE
         wait=FALSE
         exec="/usr/sbin/in.ftpd -a"
         user="root"
default  bind_addr=""
default  bind_fail_max=-1
default  bind_fail_interval=-1
default  max_con_rate=-1
default  max_copies=-1
default  con_rate_offline=-1
default  failrate_cnt=40
default  failrate_interval=60
default  inherit_env=TRUE
default  tcp_trace=FALSE
default  tcp_wrappers=FALSE
bash-3.00#

-------------- next part --------------
A non-text attachment was scrubbed...
Name: instance_clone.sh
Type: application/x-shellscript
Size: 763 bytes
Desc: not available
URL: 
<http://mail.opensolaris.org/pipermail/smf-discuss/attachments/20070215/478a7808/attachment.bin>

Reply via email to