Monday, January 29, 2018

TAP vs SPAN

  • To TAP or SPAN?
(Test Access Point)
A simple hardware device that copies all network  traffic for monitoring, analysis, and security

(Switch Port Analyzer / Mirror)
Software built into switches and routers that copies
selected packets passing through the device

To summarize, here are the top 10 reasons why network TAPs are preferred over SPAN ports:
TAPs create an exact copy of the bi-directional network  traffic at full line rate, providing full fidelity for network monitoring, analytics and security.
https://www.gigamon.com/content/dam/resource-library/english/white-paper/wp-tap-vs-span.pdf

update,build,compile freebsd

  • FreeBSD source code is located in /usr/src/.
# svn info /usr/src
If the output says '/usr/src' is not a working copy, the files there are missing or were installed with a different method. A new checkout of the source is required

https://www.freebsd.org/doc/handbook/makeworld.html

  • A checkout from a given repository is performed with a command like this:
# svn checkout https://svn.FreeBSD.org/repository/branch lwcdir


branch depends on the repository used. ports and doc are mostly updated in the head branch, while base maintains the latest version of -CURRENT under head and the respective latest versions of the -STABLE branches under stable/9 (9.x) and stable/10 (10.x).
lwcdir is the target directory where the contents of the specified branch should be placed. This is usually /usr/ports for ports, /usr/src for base, and /usr/doc for doc


This example checks out the Ports Collection from the FreeBSD repository using the HTTPS protocol, placing the local working copy in /usr/ports. If /usr/ports is already present but was not created by svn, remember to rename or delete it before the checkout.
# svn checkout https://svn.FreeBSD.org/ports/head /usr/ports

After the initial checkout, the local working copy can be updated by running
# svn update lwcdir

To update /usr/ports created in the example above, use:
# svn update /usr/ports

An alternate way of updating the local working copy after checkout is provided by the Makefile in the /usr/ports, /usr/src, and /usr/doc directories.
Set SVN_UPDATE and use the update target. For example, to update /usr/src:
# cd /usr/src
# make update SVN_UPDATE=yes


https://www.freebsd.org/doc/handbook/svn.html

  • Step 1 – Install Subversion

From ports
# cd /usr/ports/devel/subversion
# make install

From packages
# pkg_add -r subversion

Step 2 – Check Out FreeBSD Source
if you want patches since release, you are likely wanting to do Release Engineering

Release
svn checkout http://svn.freebsd.org/base/release/9.0.0/ /usr/src

Release Engineering
svn checkout http://svn.freebsd.org/base/releng/9.0/ /usr/src

Stable
# svn checkout http://svn.freebsd.org/base/stable/9 /usr/src

Currrent
# svn checkout http://svn.freebsd.org/base/head /usr/src

https://www.rhyous.com/2009/12/25/how-to-download-freebsd-source-using-svn/


  • lib32 - Compatibility libraries for running 32-bit applications on a 64-bit version of FreeBSD.
ports - The FreeBSD Ports Collection is a collection of files which automates the downloading, compiling and installation of third-party software packages
https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/using-bsdinstall.html

  • Linux® users are often surprised to find that Bash is not the default shell in FreeBSD. In fact, Bash is not included in the default installation. Instead, FreeBSD uses tcsh(1) as the default root shell, and the Bourne shell-compatible sh(1) as the default user shell. sh(1) is very similar to Bash but with a much smaller feature-set. Generally shell scripts written for sh(1) will run in Bash, but the reverse is not always true.
https://www.freebsd.org/doc/en/articles/linux-users/shells.html

  • FreeBSD provides two methods for installing applications: binary packages and compiled ports. Each method has its own benefits:
Binary Packages

    Faster installation as compared to compiling large applications.
    Does not require an understanding of how to compile software.
    No need to install a compiler.

Ports

    Ability to customize installation options.
    Custom patches can be applied.

If an application installation does not require any customization, installing the package is sufficient. Compile the port instead whenever an application requires customization of the default options. If needed, a custom package can be compiled from ports using make package.
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/linux-users/software.html

  • By default, a FreeBSD jail is created. This provides a very light-weight, operating system-level virtualization
Consider it as another independent instance of FreeBSD running on the same hardware, without all of the overhead usually associated with virtualization.
The jail will install the FreeBSD software management utilities so FreeBSD ports can be compiled and FreeBSD packages can be installed from the command line of the jail.
It is important to understand that any users, groups, installed software, and configurations within a jail are isolated from both the FreeNAS® operating system and any other jails running on that system. During creation, the VIMAGE option can be selected to provide the jail with an independent networking stack. The jail can then do its own IP broadcasting, which is required by some applications.
http://doc.freenas.org/11/jails.html

  • FreeBSD provides two methods for installing applications: binary packages and compiled ports. Each method has its own benefits:
Binary Packages

    Faster installation as compared to compiling large applications.
    Does not require an understanding of how to compile software.
    No need to install a compiler.

Ports

    Ability to customize installation options.
    Custom patches can be applied.
   
https://www.freebsd.org/doc/en_US.ISO8859-1/articles/linux-users/software.html

  • The Ports Collection is a set of Makefiles, patches, and description files.
Each set of these files is used to compile and install an individual application on FreeBSD, and is called a port.
By default, the Ports Collection itself is stored as a subdirectory of /usr/ports.
Before an application can be compiled using a port, the Ports Collection must first be installed

Procedure 4.1. Portsnap Method
The base system of FreeBSD includes Portsnap. This is a fast and user-friendly tool for retrieving the Ports Collection and is the recommended choice for most users. This utility connects to a FreeBSD site, verifies the secure key, and downloads a new copy of the Ports Collection. The key is used to verify the integrity of all downloaded files.

Procedure 4.2. Subversion Method
If more control over the ports tree is needed or if local changes need to be maintained, Subversion can be used to obtain the Ports Collection.


https://www.freebsd.org/doc/en/books/handbook/ports-using.html

subversion

  • Installing security/ca_root_nss allows Subversion to verify the identity of HTTPS repository servers. The root SSL certificates can be installed from a port:
# cd /usr/ports/security/ca_root_nss
# sudo make install clean

# cd /usr/ports/devel/subversion
# sudo make install clean

Subversion uses URLs to designate a repository, taking the form of protocol://hostname/path. The first component of the path is the FreeBSD repository to access. There are three different repositories, base for the FreeBSD base system source code, ports for the Ports Collection, and doc for documentation. For example, the URL https://svn.FreeBSD.org/ports/head/ specifies the main branch of the ports repository, using the https protocol.

repository is one of the Project repositories: base, ports, or doc.
branch depends on the repository used. ports and doc are mostly updated in the head branch, while base maintains the latest version of -CURRENT under head and the respective latest versions of the -STABLE branches under stable/9 (9.x) and stable/10 (10.x).

lwcdir is the target directory where the contents of the specified branch should be placed. This is usually /usr/ports for ports, /usr/src for base, and /usr/doc for doc.

https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/svn.html

  • Upgrading to the latest -STABLE version provides all this new code without breaking installed programs.
The name "-STABLE" is frequently misunderstood. It does not mean solid or steady. -STABLE means that while code can change, the ABI (Application Binary Interface) will remain stable and not change. Programs compiled to run on FreeBSD 10.0-RELEASE, or 10.1-RELEASE, or 10.2-RELEASE will continue to work on FreeBSD 10-STABLE. Effectively, -STABLE is the latest version of FreeBSD you can get without breaking installed software.
http://www.wonkity.com/~wblock/docs/html/stable.html