LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 03-16-2016, 07:10 PM   #1
physyx
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Rep: Reputation: Disabled
Problems using two NICs executing MSSQL PHP to multiple servers


Good evening everyone.

I'm using you as exhausted my ideas on what to do.

Environment:
I have Debian 8 (jessie) / Kernel 3.16.0-4 amd64-installed and running Apache with PHP and MySQL in a m [virtual Aquina VMWare (ESXI).

This server has two interfaces, eth0 LAN and eth1 that I will use as WAN only for external access to apache. The WAN interface for now is not with no IP configuration (already tested by placing IP too) and the LAN interface has the following configuration.

/ Etc / network / interfaces
auto eth0
iface eth0 inet static
address 10.0.1.44
netmask 255.252.0.0
gateway 10.0.1.x

Problem:
I have a PHP script that makes several row connections to multiple SQL Server databases and disconnects.

When only eth0 is enabled (LAN), the script runs perfectly connecting on all databases but when I enable eth1, it connects to some servers and does not connect in some other random.

Before you can say that is routing problem, remember that eth1 has no configuration and running the route command is only listed the default route out the eth0 and the route of the local eth0 network.


Still, I tried to put the IP of eth1 interface and configure the routes with iproute2 but exactly is the same case.

Also I get random ping problems for the IPs of SQL servers when eth1 is enabled but the problem does not exist when I disable the eth1.

I ask please that give me a light, even where I can attack the problem.

Thank you in advance those who are willing to help.
 
Old 03-17-2016, 11:28 AM   #2
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
I would start buy first looking at ifconfig and route with eth1 off. Then turn on eth1 and look at both again and see what has changed.
 
Old 03-17-2016, 12:12 PM   #3
physyx
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi lazydog and thank you for the answer.

IFCONFIG AND ROUTE ETH1 DISABLED

Code:
eth0      Link encap:Ethernet  HWaddr 00:50:b6:9a:bc:35
          inet addr:10.0.1.44  Bcast:10.3.255.255  Mask:255.252.0.0
          inet6 addr: fe80::250:b6ff:fe9a:bc35/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:486320 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10059 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:41784008 (39.8 MiB)  TX bytes:1092746 (1.0 MiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:226 errors:0 dropped:0 overruns:0 frame:0
          TX packets:226 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:46813 (45.7 KiB)  TX bytes:46813 (45.7 KiB)


Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        *               255.252.0.0     U     0      0        0 eth0

IFCONFIG AND ROUTE ETH1 ENABLED

Code:
eth0      Link encap:Ethernet  HWaddr 00:50:b6:9a:bc:35
          inet addr:10.0.1.44  Bcast:10.3.255.255  Mask:255.252.0.0
          inet6 addr: fe80::250:b6ff:fe9a:bc35/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:493417 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10215 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:42408951 (40.4 MiB)  TX bytes:1108641 (1.0 MiB)

eth1      Link encap:Ethernet  HWaddr 00:50:b6:33:32:0a
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:72478 errors:0 dropped:277 overruns:0 frame:0
          TX packets:110 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:4378592 (4.1 MiB)  TX bytes:6600 (6.4 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:226 errors:0 dropped:0 overruns:0 frame:0
          TX packets:226 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:46813 (45.7 KiB)  TX bytes:46813 (45.7 KiB)

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
10.0.0.0        *               255.252.0.0     U     0      0        0 eth0

Last edited by physyx; 03-17-2016 at 05:36 PM.
 
Old 03-17-2016, 03:46 PM   #4
lazydog
Senior Member
 
Registered: Dec 2003
Location: The Key Stone State
Distribution: CentOS Sabayon and now Gentoo
Posts: 1,249
Blog Entries: 3

Rep: Reputation: 194Reputation: 194
When pasting code you copied you should use the code tags as it make it easier to read.
Do you have a firewall enabled? Also how are you connecting to the SQL server, using host name or ip address?
Can you post a working and a non-working ping?
 
Old 03-17-2016, 05:42 PM   #5
physyx
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Sorry about that.

I already edited the codes.

I don't have any firewall enabled.

I'm connecting using ip address.

The problem using ping is much more difficult to see since the connection problem occurs randomly for each ip address. So if i try to ping an ip address it can or cannot have problem at that momento.

I already tried to use debian 7.5 thinking that could be a problem with debian 8 but no success.

One thing i will try tomorrow is to install debian directly to a computer, not using VM.
 
Old 03-18-2016, 07:54 AM   #6
physyx
LQ Newbie
 
Registered: Mar 2016
Posts: 4

Original Poster
Rep: Reputation: Disabled
Hi.

I solved the problem.

I don't know why, even the eth1 being without configuration, linux was sending some packets to that interface.

That interface is connected to a mikrotik that have cables of internal and external network pluggedin and have a rule that drop all packets except some to specific ports.

I just add a rule to allow port 1433 to that mikrotik and everything worked correctly.

Still i can't explain why that traffic was being sent to eth1 instead of eth0, maybe some linux or ESXI fail.

Very thanks for the help lazydog.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ways of executing single script on multiple servers huskie69 Linux - Server 5 09-12-2012 12:08 PM
Executing PHP script in crontab (include path problems) bar338 Linux - Newbie 5 12-21-2009 02:36 PM
DHCP problems using multiple external NICs on same subnet Leffster Linux - Networking 2 11-18-2008 11:46 AM
apache php - executing commands using system(), problems Sambojambo Programming 3 05-29-2008 11:52 AM
PHP and MSSQL BBPS Linux - Software 2 10-10-2003 10:36 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:35 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration