How to best set-up a small local 'sync' network next to the live network?

Oliver Fromme olli at
Wed Oct 5 03:47:54 PDT 2005


(This doesn't seem to be AMD64-specific, so I think it
should be moved to the -net mailing list.)

Olaf Greve <o.greve at> wrote:
 > [Setting up two machines with fall-back]
 > Primary server:
 > - Runs FreeBSD 5.4-Release AMD64
 > - Connected to outside world via NIC 1 @ a real IP address; say 
 >, publicly available as webserver incl. DNS mappings, etc.
 > - Connected via a cross-wire cable to fall-back machine via NIC 2 ; 
 > using address
 > Fall-back server:
 > - Runs FreeBSD 5.2.1-Release i386
 > - Connected to outside world via NIC 1 @ a real IP address; say 
 >, "privately" available by IP address only (mainly for SSH 
 > access, serves as fall-back and staging machine)
 > - Connected via a cross-wire cable to primary server machine via NIC 2 ; 
 > using address
 > [...]
 > -How can I best set-up such a dual network configuration, such that one 
 > network will not interfere with the other?

You machines have different IP addresses, so there is no
conflict.  It should work fine.

 > -Can I somehow 'force' the machines to automatically interpret anything 
 > in the 192.168.1.x range to be local, and hence automatically use NIC 2, 
 > instead of using the NIC 1 adapter (which handles my outside world traffic)?

That will happen automatically.  When you ifconfig an IP on
your NIC 2, it will automatically add an appropriate route
for that subnet on that NIC.

 > -Is it sufficient to set-up the Rsync daemon on the primary machine to 
 > only allow connections from, and to run as root, such that I 
 > can easily use the cross-wire as a kind of direct tunnel to perform the 
 > syncing?

Yes.  You should make sure that rsync is blocked on the
outside interfaces (using IPFW, IPFilter or PF).

Personally I don't think that rsync is the best way to
perform such a mirror.  There are other possibilities.
But if you prefer rsync, it should work.

 > -What is the nicest MySQL replication mechanism? Presently I use a 
 > mechanism that dumps the MySQL DB instances, and will then push them 
 > over an SSH tunnel to the fall-back machine, directly loading them into 
 > the MySQL DB on that machine. Is MySQL's master-slave syncing perhaps a 
 > better choice?

My personal recommendation is to use PostgreSQL 8.  Its
WAL logging feature is very well suited to synchronize
one or more slave machines, and it's rock stable and

However, if you application is Mysql-specific and cannot
easily be ported to PostgreSQL, then I'm afraid that wasn't
the answer you expected.  :-)   Mysql supports some sort
of replication, too, though.

Best regards

Oliver Fromme,  secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD:
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"... there are two ways of constructing a software design:  One way
is to make it so simple that there are _obviously_ no deficiencies and
the other way is to make it so complicated that there are no _obvious_
deficiencies."        -- C.A.R. Hoare, ACM Turing Award Lecture, 1980

More information about the freebsd-amd64 mailing list