Doing visudo you get nano instead of your favorite text editor?
Mine is vim therefore I issue:

DEBIAN/UBUNTU way

# update-alternatives --config editor
There are 4 alternatives which provide `editor'.
Selection Alternative
-----------------------------------------------
1 /usr/bin/vim.tiny
2 /bin/ed
*+ 3 /bin/nano
4 /usr/bin/vim.basic
Press enter to keep the default[*], or type selection number:

Selecting 4 I’m ready to use my full syntax colors when I edit any file.

OTHER DISTROS
Edit your .bashrc file and add the following:
EDITOR=vim
export EDITOR

Next login you will have your VIM working.
If you want to have it immediately and only for this session just type
# export EDITOR=vim
and press enter.

{ 0 comments }

I’ve come across multiple ways of doing it but so far the best way is the following (I assume you are on i386 platform and you have access to the net):
1. Download boot.img.gz from Debian website
2. Download the net-install image choosing i386.
3. Plug your USB drive into a Linux PC, open the shell and type

$ dmesg

Last few lines should be like the following:

sd 7:0:0:0: [sdb] Attached SCSI removable disk
sd 8:0:0:0: [sdb] 4030464 512-byte logical blocks: (2.06 GB/1.92 GiB)
sd 8:0:0:0: [sdb] Write Protect is off

Now we know it has been mapped as sdb

4. Use zcat to load the boot.img.gz onto your USB drive

# zcat boot.img.gz > /dev/sdb

CAUTION!!! this will destroy the entire data on the USB drive, make sure you have done the backup.
If you get an error ensure the following:
- You are root (don’t use sudo)
- The USB drive it’s not mounted, if it is umount it before issuing the above command.

5. Now mount the USB drive and copy the net-inst.iso image on it.

All done! Now plug it into the box you want to setup and enjoy the old fashion Debian installer :)

{ 0 comments }

This tip might comes handy when you do a system check and you want to make sure you don’t check the same file twice.

Let’s pretend that our “file1″ is a conf file that needs review. As you can see the output of the command issued below shows that the file was last edited in June.
Today I want to check the file without editing it and make sure next time I won’t check it again:

$ ls -l
total 0
-rw-r--r-- 1 luca luca 290 2009-06-29 16:33 file1

Touch is an excellent tool in this case:

$ touch file1
$ ls -l
total 0
-rw-r--r-- 1 luca luca 0 2009-08-29 19:43 file1

The Modification Time has changed and so has the access time.

If you want to change just the modification time leaving the access time untouched try with the -m option

$ touch -m file1
$ ls -l
total 0
-rw-r--r-- 1 luca luca 0 2009-08-29 19:46 file1
$ stat file1
[..]
Access: 2009-08-29 19:43:45.000000000 +0100
Modify: 2009-08-29 19:46:15.000000000 +0100
Change: 2009-08-29 19:46:15.000000000 +0100

And -a is just for the Access Time.

Another interesting option is -t. It lets you set the time and the date with whatever you like. This is often used to do fishy things :)

$ touch -t 200701012301 file1
$ stat file1
[..]
Access: 2007-01-01 23:01:00.000000000 +0000
Modify: 2007-01-01 23:01:00.000000000 +0000
Change: 2009-08-29 19:52:26.000000000 +0100

{ 0 comments }

All broadcasts messages are dropped by the router when it receives on an interface. This specific command is enables the router to convert the broadcast messages distended for a specific destination into unicast. This interface level command needs to be applied on the interface which the broadcast receives from.

R1(config-if)#ip helper-address 10.10.10.10

Also there are other options where you point the address to a vrf etc…

The following broadcasts are forwarded by default…

TIME – Port 37
TACACS – Port 49
DNS – Port 53
BOOTP/DHCP Server – Port 67
BOOTP/DHCP Client – Port 68
TFTP – Port 69
NetBIOS Name Service – Port 137
NetBios Datagram Service – Port 138

Other protocols can be forwarded by using the following Global config commanding…

R1(config)#ip forward-protocol udp ?

Use the ? to see the supported protocols. You may use the following command to remove a specific protocol being forwarded…

R1(config)#no ip forward-protocol udp ?

{ 0 comments }

I have been going through YouYube and found this great video about IPSec…

{ 0 comments }

This is one of the BGP configuration I have came across on my lab…

no-export : This will keep the route inside the confederation, but not to any peers.

local-as : This will keep the route inside the AS, but not even to confederation peers.

no-export –> local-as –> no-advertise

If there is no confederation present, no-export will reflect the same result as local-as.

{ 0 comments }