Introduction
How To force curl to use only one network interface.
Procedure
First, determine which network interaction your IP address is on. The easiest way to determine is to find the IP address and see the interface. Use this API call to see the public_ip and the interface.
# whmapi1 listips
---
data:
ip:
-
active: 1
dedicated: 0
if: eth0:cp1
ip: 172.16.1.6
mainaddr: 1
netmask: 255.255.255.0
network: 172.16.1.0
public_ip: 10.2.32.216
removable: 0
used: 1
Second, use the "--interface " option with curl.
Example command:
# curl --interface eeth0:cp1 https://cpanel.net/showip.shtml
10.2.32.216