Re: Source TCP port for Kannel

José Borges Ferreira <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 
Stipe Tolj wrote:

|>my Smsc gave me an UCP access but it requires me to connect FROM a
defined
|>PORT and IP address TO a defined PORT and IP address.
|>
|>Saying that the EMI/UCP server I need to connect TO is 191.9.65.89
port 5002
|>and that my kannel box should connect from 242.31.225.60 port 9000
|>
|>I've set:
|>group = smsc
|>smsc = emi
|>host = 191.9.65.89
|>port = 5002
|>smsc-username = Pamela
|>smsc-password = Anderson
|>keepalive = 60
|>our-port = 9000
|>receive-port = 900
|>
|>If I trace the connection with tcpdump, I get that my kannel box
connects
|>from 242.31.225.60 port 62523 (this port changes) and not the 9000 as
|>specified in the connection.
|>
|>Question:
|>1) Am I doing something wrong ?
|>2) If the our-port does not provide the source port config
parameter, how do
|>I setup kannel to open the tcp from the port 9000 ?
|
|
|the 'our-port' defines the _server_ port of your side of the UCP
|server itself is about to establish an TCP connection for MO
|tranmissions ie. It is _not_ defining the client TCP port of the
|connection towards the server. The OS is assigning this socket port
|and you _don't_ have a way in defining this inside Kannel's config
|file.
|
I had the same limitation so i have emi2 set as a SMSc with this setup:

group = smsc
smsc=emi2
host = 10.11.14.13
port = 6611
our-host = 10.22.11.24
our-port = 4982

And all connection goes with src port 4982.
a netstat will show

tcp        0      0 10.22.11.24:4790         10.11.14.13:6611      
ESTABLISHED

and works fine, except for restarts where i have to wait 1 minuto
before the socket will be  killed ( but that's more an SO issue than a
kannel issue).

|You'll have to go with Linux IP tables and NAT rules to map this.
|Unfortunatly I can't drop you an very easy example for this. You
|should either patch Kannel's source to define a hard way in connecting
|with pre-defined client ports or ask your local Linux guru about the
|OS IP layer way in doing this.
|
You could use inetd to listen to a ip:port ans "send" it to netcat and
reset the source ip:port then.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (MingW32)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
 
iD8DBQFAL5snbzMzHSz3fVcRAoU6AJ0YMMfcE7ey2q4xTxBJ58sH7QFuyACfU7Jg
CxGsV7cvAQigBLIMxYYjtpA=
=XGS3
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.