blog.up-link.ro
4Feb/120

FreeBSD: How to set up an UPnP Internet Gateway Device (IGD) with MiniUPnP and FreeBSD 9.0

Universal Plug and Play (UPnP) is a set of networking protocols that permits networked devices, such as personal computers, printers, Internet gateways, Wi-Fi access points and mobile devices to seamlessly discover each other's presence on the network and establish functional network services for data sharing, communications, and entertainment.

The MiniUPnP project offers software which supports the UPnP Internet Gateway Device (IGD) specifications.

For the purposes of this article I'll assume you're familiar with setting up NAT under FreeBSD using OpenBSD Packet Filter. I'll also assume that your machine is up, routing and translating traffic correctly and is protected by OpenBSD Packet Filter (PF).

Print This Post Print This Post
27Dec/110

FreeBSD: How to Install and Configure a PPTP VPN server with mpd5 on FreeBSD 8.2

The Point-to-Point Tunneling Protocol (PPTP) is a method for implementing virtual private networks. PPTP uses a control channel over TCP and a GRE tunnel operating to encapsulate PPP packets.

In this document we will see how to install and configure Mpd5 as a PPTP server, allowing remote VPN connections. This setup has been tested and works well on FreeBSD 8.2 system and Mpd version 5.5.

Print This Post Print This Post
24Nov/110

UNIX Tips: How to find broken symbolic links

In computing, a symbolic link (also symlink or soft link) is a special type of file that contains a reference to another file or directory in the form of an absolute or relative path and that affects pathname resolution.

1. To display a list of the broken links, execute:

find -L ${dir} -type l

2. To remove the broken links, execute:

find -L ${dir} -type l -print0 | xargs -0 rm
Do not forget to replace ${dir} with the desired directory.

Print This Post Print This Post


25Oct/110

FreeBSD: How to mount SMB/CIFS shares under FreeBSD

This document provides help on mounting SMB/CIFS shares under FreeBSD Operating System.
The mount_smbfs command mounts a share from a remote server using SMB/CIFS protocol. You can easily mount MySharedFolder share using the following syntax:

mount_smbfs -I 192.168.1.1 //myUser@serverName/mySharedFolder /mnt/mySharedFolder

Where,
192.168.1.1 is the IP address of the remote computer.
myUser is your user name.
serverName is NETBIOS Server Name.
mySharedFolder is CIFS share name.
/mnt/mySharedFolder is the local mount point directory.

Print This Post Print This Post
22Sep/110

UNIX Tools: pipe viewer (pv) – monitor the progress of data through a pipe

Pipe Viewer (pv) allows a user to see the progress of data through a pipeline, by giving information such as time elapsed, percentage completed (with progress bar), current throughput rate, total data transferred, and estimated time of arrival.

pv can be inserted into any normal pipeline between two processes to give a visual indication of how quickly data is passing through, how long it has taken, how near to completion it is, and an estimate of how long it will be until completion.

Print This Post Print This Post
30Jul/110

FreeBSD: How To Enable ccache on FreeBSD 8.2

ccache is a software development tool that caches the output of C/C++ compilation so that the next time, the same compilation can be avoided and the results can be taken from the cache. This can greatly speed up recompiling time.

The following is a step by step guide to how to enable and use ccache on FreeBSD 8.2.

Install ccache by running the following command:

make install clean -C /usr/ports/devel/ccache
Print This Post Print This Post
29Jul/110

FreeBSD: How To Rename Network Interfaces

To rename a network interface under FreeBSD, invoke ifconfig command as root:

ifconfig bge1 name net1

Observe that the interface formerly known as bge1 is now net1. To keep the change after reboot, add the following lines to /etc/rc.conf:

ifconfig_bge1_name="net1"
ifconfig_net1="inet 192.168.0.1 netmask 255.255.255.0"

Print This Post Print This Post
15May/110

FreeBSD: How To Install FreeBSD 8.x from USB Flash Drive

FreeBSD 8 can be installed from a USB memory stick. The required files can be downloaded via FTP:

i386: ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/ISO-IMAGES/8.2/FreeBSD-8.2-RELEASE-amd64-memstick.img
amd64: ftp://ftp.freebsd.org/pub/FreeBSD/releases/amd64/ISO-IMAGES/8.2/FreeBSD-8.2-RELEASE-amd64-memstick.img

Insert the USB drive into the computer running Linux/FreeBSD and make sure it gets detect by the Kernel. You can check if the USB device got detect or not by running the following command:

dmesg
Print This Post Print This Post
17Nov/100

How To Install QEMU under FreeBSD 8.1 as Host OS

QEMU is a processor emulator that relies on dynamic binary translation to achieve a reasonable speed while being easy to port on new host CPU architectures.
When used as a machine emulator, QEMU can run Operating Systems and programs made for one machine on a different machine. By using dynamic translation, it achieves very good performance.
When used as a virtualizer, QEMU achieves near native performances by executing the guest code directly on the host CPU.

1. Install QEMU

To install QEMU under FreeBSD, enter:

make install clean -C /usr/ports/emulators/qemu

Install QEMU with options showed in the following image:

Print This Post Print This Post
16Oct/100

SSH Security: How To Block SSH Brute Force Attacks with SSHGuard

SSHGuard monitors logging activity and reacts to attacks by blocking their source IP addresses. sshguard has born for protecting SSH servers from the today's widespread brute force attacks, and evolved to an extensible log supervisor for blocking attacks to applications in real-time.

SSHGuard is given log messages in its standard input. By means of a parser, it decides whether an entry is normal activity or attack. After a number of attacks, the IP address is blocked with the firewall.

These are the available blocking backends:

  • SSHGuard with PF (OpenBSD, FreeBSD, NetBSD, DragonFly BSD)
  • SSHGuard with IP FILTER (FreeBSD, NetBSD, Solaris)
  • SSHGuard with IPFW (FreeBSD, Mac OS X)
  • SSHGuard with netfilter/iptables (Linux)
  • SSHGuard with TCP wrappers / hosts.allow (almost any UNIX system)
Print This Post Print This Post