Re: Source TCP port for Kannel
-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 tcp0 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-
RE: Source TCP port for Kannel
Configuring NAT is not the only option. I have the same issue with outgoing local port with my local telco, and in my sms application written in perl I have easily passed it with LocalPort option of IO::Socket::INET object. I think it is done with bind(2) and can be easily implemented in kannel.
Re: Source TCP port for Kannel
On 13.02.2004, at 19:27, Misc wrote: Hi there, 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. if you ask me, ask your UCP providers to read a book about how TCP/IP works. Forcing you to use a specific tcp port on originating side makes no sense. It limits you to a single session also. Outgoing sessions are alwways dynamically assigned. A session is unique by its IP address and port pairs. Thats why you can not have two sessions if you use the same IP's and same ports. In my eyes they are just too lazy to configure their firewall properly. Andreas Fink Global Networks Switzerland AG -- Tel: +41-61-330 Fax: +41-61-334 Mobile: +41-79-2457333 Global Networks, Inc. Clarastrasse 3, 4058 Basel, Switzerland Web: http://www.global-networks.ch/ [EMAIL PROTECTED] -- PGP Fingerprint: B982 00B7 FFB5 0B33 BFF8 0F77 1E23 F3CA B4A3 D0B8
Re: Source TCP port for Kannel
Replying to Stipe Tolj: > 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. > > 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. something like iptables -t nat -A POSTROUTING -j SNAT -d ... but your kernel needs to be compiled with following config IP_NF_NAT_LOCAL bool "NAT of local connections (READ HELP)" depends on IP_NF_NAT help This option enables support for NAT of locally originated connections. Enable this if you need to use destination NAT on connections originating from local processes on the nat box itself. Please note that you will need a recent version (>= 1.2.6a) of the iptables userspace program in order to use this feature. See http://www.iptables.org/ for download instructions. -- Paul P 'Stingray' Komkoff Jr // http://stingr.net/key <- my pgp key This message represents the official view of the voices in my head
Re: Source TCP port for Kannel
> 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. 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. Stipe mailto:[EMAIL PROTECTED] --- Wapme Systems AG Münsterstr. 248 40470 Düsseldorf, NRW, Germany phone: +49.211.74845.0 fax: +49.211.74845.299 mailto:[EMAIL PROTECTED] http://www.wapme-systems.de/ --- -BEGIN PGP PUBLIC KEY BLOCK- Version: GnuPG v1.2.2 (Cygwin) mIsEP6mcYwEEAMDnUiUwrbb+xwTFWN6TxF2+XZu7/alwJMeCwMBRvXtPZqfjpPhS OkBpU0F4TrVuugz1HINTSaJTYq10AzDQXp5NkyWgckqW79nPAWuOX0dicbJk+cN2 nM2TI4KaxUDe6u8hghNEnH/i2lXsUu9apnP/iixzV81VC2je3uc9hZpnAAYptEVT dGlwZSBUb2xqIChUZWNobm9sb2d5IENlbnRlciAmIFJlc2VhcmNoIExhYikgPHRv bGpAd2FwbWUtc3lzdGVtcy5kZT6ItAQTAQIAHgUCP6mcYwIbAwYLCQgHAwIDFQID AxYCAQIeAQIXgAAKCRABV0w1BqPYRuSqA/wPzsQxao2YePENCtgRTrO86U6zg3sl OcS6CJFI4FZP5h/xD3GRsNH1+MPSvZlomDdpFnr547DGz/Kq9MXuQwVvlVig5yWZ K5dtKp1r5YLhxJQBhfirZbRFFnYmf19f18J8OoS28tuFVftDl1AIwJS3HLyBTv6H g2HyLAEKQIp30Q== =aYCI -END PGP PUBLIC KEY BLOCK-
AW: Source TCP port for Kannel
If things fail and you are on Linux, I'm sure one can build a NAT rule that maps your source port to the desired one. Regards Jörg -Ursprüngliche Nachricht- Von: Misc [mailto:[EMAIL PROTECTED] Gesendet: Freitag, 13. Februar 2004 19:28 An: [EMAIL PROTECTED] Betreff: Source TCP port for Kannel Hi there, 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 ? Thanks to all Julien
Source TCP port for Kannel
Hi there, 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 ? Thanks to all Julien