Thursday, November 26, 2009

FreeBSD 8.0 Released!!!

Hey came today a great news of FreeBSD 8.0 release. Cant wait to put my hand on it. But I will hold on till the initial rush runs down and any issues prop up and settle down.
So here is the news we all are waiting for!
http://www.freebsd.org/releases/8.0R/relnotes.html

Whats interesting for me in that?
OK here they are
1.  FreeBSD 8.0-RELEASE 
2.  A new virtualization container named “vimage” has been implemented.
3.   The FreeBSD netisr framework has been reimplemented for parallel threading support.
4.   The FreeBSD TTY layer has been replaced with a new one 
5.   The FreeBSD Linux emulation layer has been updated 
6.   Includes Trusted BSD MAC 
7.   The FreeBSD USB subsystem 
8.   The ZFS file system has been updated
9.   The FreeBSD NFS v4 subsystem
10. The wireless network support layer (n
11. The GCC stack protection
12. Gnome and KDE


These are some of them though many I wont be using as for me whats interesting
 will be something I can use it in Server side




Anyway Ejnoy

Wednesday, November 18, 2009

Server under attack, How to deal with it by the help of bsd PF

Hammering those Hammers

If your server gets under attack what can be done and how we will be able to prevent server going down with hammering from the attackers
Few simeple steps with pf can do magic instead of some high fi pocket crashing firewalls

Say the server we want to protect is our web server

Add the following to the /etc/pf.conf
# Ok all the attackers goes to presistant mode with a file in /etc/pf.blocklist so
table persist file "/etc/pf.blocklist"

# block all incoming connections from attackers on FTPD
block in quick on $ext_if from

# Allow we server access with protection from hammering
pass in quick on $ext_if inet proto tcp from any to ($ext_if) port 80 keep state (max-src-conn-rate 5/40, overload flush global)

So  what the previous lines gona do

i.e if any ip produces more than 5 connections in 40 seconds time, that ip gona end up in pf table of hammers and who are in pf table of hammers are blocked with block in command bfore that

But this work as long as system doesnt restart or pf looses the table so lets make it permanent by adding it to rc.shutdown

# echo '/sbin/pfctl -t ftp-attacks -T show > /etc/pf.blocklist' >> /etc/rc.shutdown

Woah!  Next time even if the system reboots we have the list of those guys who tried to hammer our web server.

See how easy and cool it is
Yes ofcoz I came across from the net and used it for my purpose

Monday, November 9, 2009

Setting Fixed IP for Specific Hosts

When you need to have to fix ip for some systems  but supplied through DHCP
We need to add specific sections in /usr/local/etc/dhcp.conf

Add the following to /usr/local/etc/dhcp.conf
host {
hardware ethernet ;
fixed-address ;
option domain-name-servers ;
option domain-name "";
option routers ;
}

Ok save and quit the file
restart dhcpd
#/usr/local/etc/rc.d/isc-dhcpd restart

Ok there you go!
Enjoy! :)

Sunday, November 8, 2009

Changing network settings without rebooting

Did ever wondered how to get the network settings change to applied immediately in Freebsd?
In Linux we had much easier service network restart
So after a few searches I found we have two commands in our help
Any changes to /etc/rc.conf
just run
#/etc/rc.d/netif restart

Any changes to routing to take place
#/etc/rc.d/routing restart

Yeah that two commands are my best friends when fiddling around with network settings
Enjoy :)

Tuesday, November 3, 2009

Mounting ISO files

Often we come across a situation where it would be great if we can peak into an ISO file content.
In freebsd things have changed these days on how we can mount a ISO file. Previously we were mounting that ISO file to a loopback device which no longer works now
So the steps to mount a ISO file are as follows
We gona take help of mdconfig

But bfore doing anything lets create a directory at root for mounting purpose
#mkdir /cddump

Ok lets create the md device file the iso file mounting
#mdconfig -a -t vnode -f

Once you are successful with it lets mount it to tle directory we created
#mount -t cd9660 /dev/md0 /cddump

Ok thats it, change the directory to /cddump and have a look at the content.
Enjoy