V
V
Valery2013-10-10 08:01:54
PHP
Valery, 2013-10-10 08:01:54

mssql_connect() via the server's second white IP. How?

Good morning,

I have a FreeBSD server with two white IPs:

%ifconfig
em0: flags=8c02<BROADCAST,OACTIVE,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 00:1e:67:13:ff:63
        media: Ethernet autoselect
        status: no carrier
em1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=4219b<RXCSUM,TXCSUM,VLAN_MTU,VLAN_HWTAGGING,VLAN_HWCSUM,TSO4,WOL_MAGIC,VLAN_HWTSO>
        ether 00:1e:67:13:ff:62
        inet 185.12.*.* netmask 0xffffff00 broadcast 185.12.*.*
        inet 37.202.*.* netmask 0xffffffff broadcast 37.202.*.*
        media: Ethernet autoselect (100baseTX <full-duplex>)
        status: active
ipfw0: flags=8801<UP,SIMPLEX,MULTICAST> metric 0 mtu 65536


To communicate with the outside world, 185.12 .*.* is used by default
when trying to connect to MSSQL from PHP, this IP is also automatically used.

when trying to connect:
mssql_connect('212.176.*.*:3341', 'user', 'pass');

The remote MSSQL server should think our IP is 37.202.*.* and not 185.12.*.*

How can I force PHP to use the second address 37.202.*.* to communicate with MSSQL in one of the scripts?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
truekenny, 2013-10-10
@Akuma

It is necessary to configure routing on the computer so that the gateway of the second white IP is used to access the MSSQL server.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question