> The simple answer is no: if you want subnet-local broadcast traffic to
> be received, then your DB servers and your clients need to be on the
> same subnet.  Routers are designed and required to not propagate
> broadcast traffic, although you could switch to doing bridging rather
> than routing.  Or, you could set up Sybase's SQL.INI to list all of the
> databases you care about, if I recall correctly...

Actually, a little perl script (running daemonized on the firewall) for
each of the USERS networks solved my problem. It is somewhat ugly, but it

#!/usr/local/bin/perl -w
# syproxy - Sybase broadcast proxy

use File::Basename;
use Fcntl qw(LOCK_EX LOCK_NB);
use IO::Socket;
use strict;
use Net::RawIP;

### Configuration
# Destination IP (broadcast) of the servers network
# Sybase port
my $PORT = 2638;
# Broadcast address of the USERS network
my $LISTEN = "";
# Packet length
my $MAXLEN = 1024;

my $sport;
my $source;
my $ipaddr;
my $data;
my $progname = basename($0);

# Selflock
open(SELFLOCK, "<$0") or die("Couldn't open $0: $!\n");
flock(SELFLOCK, LOCK_EX | LOCK_NB) or die("Aborting: another $progname is 
already running\n");

# Double-fork to avoid leaving a zombie process behind:
exit if (fork());
exit if (fork());
sleep 1 until getppid() == 1;

# Create the socket
my $recv_socket = IO::Socket::INET->new(
 Proto          => 'udp',
 LocalPort      => $PORT,
 LocalAddr      => $LISTEN,
 Broadcast      => 1,
 ReuseAddr      => 1
) or die "Creating socket: $!\n";

while (1) {
        # Wait for packets
        $recv_socket->recv($data, $MAXLEN);

        # Get the sender address
        ($sport, $ipaddr) = unpack_sockaddr_in($recv_socket->peername);
        $source = inet_ntoa($ipaddr);

        # Construct the packet
        my $send_socket = new Net::RawIP({udp =>{}});
        $send_socket->set({ip => {saddr => $source , daddr => $DESTINATION,
                           tos => 22}, udp  => {source => $sport,
                           dest => $PORT, data => $data }});

        # Send the spoofed packet

freebsd-questions@freebsd.org mailing list
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to