I have two interfaces on my server, eth0 and eth0:0. Those are two different external IP addresses and obviously two different reverse domains.
When I open a IO::Socket::INET connection, Perl uses the eth0 interface by default. I would like to use the second interface (eth0:0) because this has a different IP and I dont want to use my main IP or domain.
I have absolutely no idea how to select which interface to connect through.
Here's the code I use to open a socket:
my $sock = new IO::Socket::INET(PeerAddr => $server,
PeerPort => $serverPort,
Proto => 'tcp') or
die "Can't connect to server: $!";