Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LocalAddr is ignored in IO::Socket::INET under currently unknown conditions #1118

Closed
julsemaan opened this issue Jan 8, 2016 · 11 comments · Fixed by #1079
Closed

LocalAddr is ignored in IO::Socket::INET under currently unknown conditions #1118

julsemaan opened this issue Jan 8, 2016 · 11 comments · Fixed by #1079
Assignees

Comments

@julsemaan
Copy link
Collaborator

Due to, as discovered below, iptables NATing the whole system on the management

@julsemaan
Copy link
Collaborator Author

If 192.168.73.111 is the server IP and 192.168.73.210 is the VIP

The script below will make the request leave from source IP 192.168.73.111

use strict;
use warnings;
use lib qw(/usr/local/pf/lib);
use IO::Socket;
use strict;

foreach my $addr (qw(192.168.73.210)) {
    my $sock = IO::Socket::INET->new(
        Proto     => 'udp',
        PeerPort  => 5000,
        PeerAddr  => '192.168.73.112',
        LocalAddr => $addr,
    ) or die "Could not create socket: $!\n";

    $sock->send('a file to have your advice') or die "Send error: $!\n";
}

@jrouzierinverse
Copy link
Member

This is also happening for tcp traffic.

@jrouzierinverse
Copy link
Member

This seems to be an issue with the configuration of server.
You see the same behavior with the following command.

echo Hello | nc -w 1 -v -u -s 192.168.73.210 192.168.73.112 5000

Most likely it is a mis-configured iptables.(Manually or programmatically )

Chain POSTROUTING (policy ACCEPT)
num target prot opt source destination
1 SNAT all -- 0.0.0.0/0 0.0.0.0/0 to:192.168.73.111
2 SNAT all -- 169.254.0.0/16 0.0.0.0/0 to:192.168.73.111

Since I am not an iptables expert can someone please confirm my suspicions.

@jrouzierinverse
Copy link
Member

This is a configuration issue

@julsemaan
Copy link
Collaborator Author

This is not a config issue,

This is a problem in the iptables in active/active clustering that PacketFence is generating.

@dwlfrth is looking into it, I'll assign him

@julsemaan julsemaan reopened this Jan 8, 2016
@julsemaan julsemaan assigned dwlfrth and unassigned jrouzierinverse Jan 8, 2016
@fdurand
Copy link
Member

fdurand commented Jan 8, 2016

#1079 ?

@julsemaan
Copy link
Collaborator Author

@fdurand

Lol, yes that pretty much looks like a fix :)

Guess this is now on milestone 5.6

@dwlfrth
Copy link
Contributor

dwlfrth commented Jan 8, 2016

Now we're jasing !

@julsemaan
Copy link
Collaborator Author

You're jasing in the past ?

@dwlfrth
Copy link
Contributor

dwlfrth commented Jan 8, 2016

Wut ? ;)

@julsemaan
Copy link
Collaborator Author

Forget it,

I'm in the 'Friday afternoon bad jokes' mood

@dwlfrth can you check @fdurand PR, looks good to me but I'm not inline expert

We'd need to be able to put it in 5.6 since this is affecting active/active clusters with passthroughs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants