Operating System - HP-UX
1825822 Members
2997 Online
109688 Solutions
New Discussion

How do you force ftp to use a specific NIC?

 
charlie_bulosan
Frequent Advisor

How do you force ftp to use a specific NIC?


Hi All,

I have 3 Network Interface Cards (1x1000BSX Fiber NIC, 1x1000BT copper and 1x4-port 100BT copper).
lan0 belongs to 1000BT NIC
lan1 belongs to 1000BSX NIC
lan3 belongs to 100BT NIC

Currently lan0 is the one being used for ftp, but I would like to use lan1 as this is a Fiber.

Below are the output of netstat -in, netstat -rn and ioscan -fnClan.

root@ [/root]# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan3 1500 10.1.0.0 10.1.2.32 23833104 0 46090056 0 0
lan1 1500 10.1.0.0 10.1.3.32 391834022 0 922163650 0 0
lan0 1500 10.1.0.0 10.1.1.32 1915092956 0 1913271609 0 0
lo0 4136 127.0.0.0 127.0.0.1 1581327593 0 1581330693 0 0
root@ [/root]# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.1.1.32 10.1.1.32 UH 0 lan0 4136
10.1.3.32 10.1.3.32 UH 0 lan1 4136
10.1.2.32 10.1.2.32 UH 0 lan3 4136
10.1.0.0 10.1.2.32 U 2 lan3 1500
10.1.0.0 10.1.1.32 U 2 lan0 1500
10.1.0.0 10.1.3.32 U 2 lan1 1500
192.168.139.25 10.1.3.1 UGH 0 lan1 0
164.144.100.31 10.1.3.1 UGH 0 lan1 0
164.144.100.0 10.1.3.1 UG 0 lan1 0
164.144.0.0 10.1.3.1 UG 0 lan1 0
172.16.1.110 10.1.3.1 UGH 0 lan1 0
172.16.1.116 10.1.3.1 UGH 0 lan1 0
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.1.3.1 UG 0 lan1 0
root@ [/root]# ioscan -fnC lan
Class I H/W Path Driver S/W State H/W Type Description
========================================================================
lan 0 0/1/2/0 igelan CLAIMED INTERFACE HP A6825-60101 PCI 1000Base-T Adapter
lan 1 0/2/1/0 igelan CLAIMED INTERFACE HP A6847-60101 PCI 1000Base-SX Adapter
lan 2 0/5/1/0/4/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
lan 3 0/5/1/0/5/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
lan 4 0/5/1/0/6/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port
lan 5 0/5/1/0/7/0 btlan CLAIMED INTERFACE HP A5506B PCI 10/100Base-TX 4 Port


Many thanks,
Charlie
7 REPLIES 7
Ninad_1
Honored Contributor

Re: How do you force ftp to use a specific NIC?

The server where you are ftping the data, does it have similar fibre connectivity and does it have ip address from 10.1.3.x network ?
If yes, then by default it should use the fibre and no routing will take place. On the other hand if the target server does not have high speed link, then the effective throughput will be limited to the smallest b/w of the link.
Also if you have rcp or scp enabled, then you can use similar to below example.
scp 10.1.3.32:/xyz 10.1.3.33:/xyz

Regards,
Ninad
charlie_bulosan
Frequent Advisor

Re: How do you force ftp to use a specific NIC?

Hi Ninad,

Sorry forgot to tell that the server is external and ftp go through the internet. We initiate the ftp locally.


Thanks,
Charlie
Ninad_1
Honored Contributor

Re: How do you force ftp to use a specific NIC?

If that is the case, do you have the answer to the question - do you get 100Mbps end to end, else how will it be useful for you to use the the 1000 Mbps ?

Regards,
Ninad
charlie_bulosan
Frequent Advisor

Re: How do you force ftp to use a specific NIC?

Ninad,

You're right you'll not be able to fully utilize the 1000B-Sx fibre NIC.

I've tested rcp between two test servers using their gigabit NICs but somehow they did not use them. See the Ipkts and Opkts below of their gigabit NICs before and after the rcp is finish.

root@bsi09[/tmp]# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan10 1500 10.1.3.0 10.1.3.54 1307421 0 2014656 0 0
lan1 1500 10.1.2.0 10.1.2.24 1959912 1 7605 0 0
lan0 1500 10.1.1.0 10.1.1.24 281578849 0 284754732 0 0
lo0 4136 127.0.0.0 127.0.0.1 308241787 0 308247718 0 0
lan6 1500 10.1.2.0 10.1.2.54 10074 0 14486 0 0
lan5 1500 10.1.3.0 10.1.3.24 1117518 0 580858 0 0
root@bsi09[/tmp]# rcp -p bsi09da1:/stand/vmunix bsi13da1:/tmp &
[1] 3857
root@bsi09[/tmp]# rcp -p bsi09da1:/stand/vmunix bsi13da1:/tmp &
[2] 4119
[1] - Done rcp -p bsi09da1:/stand/vmunix bsi13da1:/tmp &
root@bsi09[/tmp]# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan10 1500 10.1.3.0 10.1.3.54 1307421 0 2014656 0 0
lan1 1500 10.1.2.0 10.1.2.24 1966492 1 7605 0 0
lan0 1500 10.1.1.0 10.1.1.24 281618620 0 284803391 0 0
lo0 4136 127.0.0.0 127.0.0.1 308241917 0 308247848 0 0
lan6 1500 10.1.2.0 10.1.2.54 10074 0 14486 0 0
lan5 1500 10.1.3.0 10.1.3.24 1123731 0 653589 0 0
[2] + Done rcp -p bsi09da1:/stand/vmunix bsi13da1:/tmp &


root@bsi13[/tmp]# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan9 1500 10.1.3.0 10.1.3.42 231645 0 177684 0 0
lan1 1500 10.1.2.0 10.1.2.42 2058 0 2424 0 0
lan0 1500 10.1.1.0 10.1.1.42 284547 0 242042 0 0
lo0 4136 127.0.0.0 127.0.0.1 487656 0 487656 0 0
root@bsi13[/tmp]# netstat -in
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
lan9 1500 10.1.3.0 10.1.3.42 231645 0 177684 0 0
lan1 1500 10.1.2.0 10.1.2.42 2058 0 2424 0 0
lan0 1500 10.1.1.0 10.1.1.42 284554 0 242047 0 0
lo0 4136 127.0.0.0 127.0.0.1 487656 0 487656 0 0



Thanks,
Charlie

Geoff Wild
Honored Contributor

Re: How do you force ftp to use a specific NIC?

You could create a static route to the internet to always go out your 1GB interface.

Just add a route to your /etc/rc.config.d/netconf file

Note: this will cause all traffic to the internet to go through that interface.

Rgds...Geoff

Proverbs 3:5,6 Trust in the Lord with all your heart and lean not on your own understanding; in all your ways acknowledge him, and he will make all your paths straight.
Ninad_1
Honored Contributor

Re: How do you force ftp to use a specific NIC?

The way you can use the gig links for your rcp is.
On server 1 use lanscan and check which are your gig links, check the ip address of this port (Say it is 10.1.3.32)
Do the same on the 2nd server (say it is 10.1.3.63)
Now do
rcp 10.1.3.32:/xyz 10.1.3.63:/xyz
Thus you are directing to use those particular ports for sending the data traffic.

Regards,
Ninad
charlie_bulosan
Frequent Advisor

Re: How do you force ftp to use a specific NIC?

Ninad,

I've followed your example above. The hosts/aliases bsi09da1 and bsi13da are sitting on the 10.1.3.0 subnet.

bsi09da1 is 10.1.3.24 and
bsi13da1 is 10.1.3.42


Geoff,

I think it is already using the gigabit interface. See below output of netstat -rn. The 10.1.3.1 default gateway should talk the 10.1.3.32 gigabit NIC. Unless there is something wrong with my netconf file?

root@bsi14[/root]# netstat -rn
Routing tables
Destination Gateway Flags Refs Interface Pmtu
127.0.0.1 127.0.0.1 UH 0 lo0 4136
10.1.1.32 10.1.1.32 UH 0 lan0 4136
10.1.3.32 10.1.3.32 UH 0 lan1 4136
10.1.2.32 10.1.2.32 UH 0 lan3 4136
10.1.0.0 10.1.2.32 U 2 lan3 1500
10.1.0.0 10.1.1.32 U 2 lan0 1500
10.1.0.0 10.1.3.32 U 2 lan1 1500
192.168.139.25 10.1.3.1 UGH 0 lan1 0
164.144.100.31 10.1.3.1 UGH 0 lan1 0
164.144.100.0 10.1.3.1 UG 0 lan1 0
164.144.0.0 10.1.3.1 UG 0 lan1 0
172.16.1.110 10.1.3.1 UGH 0 lan1 0
172.16.1.116 10.1.3.1 UGH 0 lan1 0
127.0.0.0 127.0.0.1 U 0 lo0 0
default 10.1.3.1 UG 0 lan1 0



Below is the routing configuration from netconf file of the server.

ROUTE_DESTINATION[0]="default"
ROUTE_MASK[0]=""
ROUTE_GATEWAY[0]="10.1.3.1"
ROUTE_COUNT[0]="1"
ROUTE_ARGS[0]=""

ROUTE_DESTINATION[1]="net 172.16.1.110"
ROUTE_MASK[1]="255.255.255.255"
ROUTE_GATEWAY[1]="10.1.3.1"
ROUTE_COUNT[1]="1"
ROUTE_ARGS[1]=""

ROUTE_DESTINATION[2]="net 172.16.1.116"
ROUTE_MASK[2]="255.255.255.255"
ROUTE_GATEWAY[2]="10.1.3.1"
ROUTE_COUNT[2]="1"
ROUTE_ARGS[2]=""

ROUTE_DESTINATION[3]="net 192.168.139.25"
ROUTE_MASK[3]="255.255.255.255"
ROUTE_GATEWAY[3]="10.1.3.1"
ROUTE_COUNT[3]="1"
ROUTE_ARGS[3]=""

ROUTE_DESTINATION[4]="net 164.144.100.31"
ROUTE_MASK[4]="255.255.255.255"
ROUTE_GATEWAY[4]="10.1.3.1"
ROUTE_COUNT[4]="1"
ROUTE_ARGS[4]=""

ROUTE_DESTINATION[5]="net 164.144.0.0"
ROUTE_MASK[5]="255.255.0.0"
ROUTE_GATEWAY[5]="10.1.3.1"
ROUTE_COUNT[5]="1"
ROUTE_ARGS[5]=""

ROUTE_DESTINATION[6]="net 164.144.100.0"
ROUTE_MASK[6]="255.255.255.0"
ROUTE_GATEWAY[6]="10.1.3.1"
ROUTE_COUNT[6]="1"
ROUTE_ARGS[6]=""


Many Thanks,
Charlie