Enabling multicontext mode on the Cisco ASA 5500 series

Enabling multicontext mode on the Cisco ASA 5500 series is simple. You simply type “mode multiple” in config terminal mode. This command will completely change the behaviour of your device, and likely scrap alot of your config. So I would suggest doing the proper reading on it before attempting to do this. The device will reboot immediately after confirming that you actually want to proceed.

lab-asa(config)# mode multiple
WARNING: This command will change the behavior of the device
WARNING: This command will initiate a Reboot
Proceed with change mode? [confirm]
Convert the system configuration? [confirm]
!
The old running configuration file will be written to flash

The admin context configuration will be written to flash

The new running configuration file was written to flash
Security context mode: multiple

 

***
*** — SHUTDOWN NOW —
***
*** Message to all terminals:
***
***   change mode

After the boot, you will enter the admin context of the device upon SSHing to the usual management interface IP. You can now start creating multiple contexts (if you have the proper licence) The base config and context config of the device can be edited from the system context (“changeto context system“)

You can scrap your multiple context mode and revert to single context by doing “mode single” whenever you like. Both of these commands will change your config and the behaviour of your firewall, so make sure you make the appropriate config backups before you do this.

Tags: , , ,

Connect to a RS-232 serial device with ‘cu’ with Linux or MacOS

Ever wanted a simple Linux or MacOS command line utility to connect to RS-232 based devices? Search no more. For MacOS it is natively shipped with the OS, but for Linux you probably need a UUCP source file or a repository install (I know it exists for Ubuntu atleast) Here is the command to connect to “ttyS0″ (requires superuser):

enigma:~ vidarst$ sudo cu -l /dev/ttyS0 -s 9600

PS! You need to investigate which serial device is the proper name for your own. Doing “dmesg | grep serial”, or investigating “/proc”  should help you out. Or just Google it!

Tags: , , ,

Enabling telnet login in IOS on Cisco Catalyst series

It is not too often you have to enable telnet on modern Catalyst switches, as SSHv2 is more and more used due to its higher level of security. But every now and then, I blow dust off old switches with a non crypto OS and deploy them before I upgrade the IOS. So how do I get them “on the air” with telnet to access them remotely? First of all, you need a management IP or L3 interface to telnet to. Please note that the following config will render your login password in cleartext on older IOS releases (that doesn’t support password-encryption), which is considered as highly insecure and bad.

Then do the following config:

my-switch#config terminal
my-switch(config)#line vty 0 4
my-switch(config-line)#login
my-switch(config-line)#transport input telnet
my-switch(config-line)#password somepassword
my-switch(config-line)#line vty 5 15
my-switch(config-line)#login
my-switch(config-line)#transport input telnet
my-switch(config-line)#password somepassword

(Please note that VTY chunks may differ on your own setup, so you might have to change the “line vty X X” syntax)

Tags: , ,

iPhone/iPad “forgets” some wireless network passwords

For quite a time, I had this weird problem with my iPhone(3G) where it would randomly “forget” some networks, but work just fine elsewhere. When I tried to enter the password again, it would say “Network Unavailable”, which it wasn’t.. The most annoying place this happened, was at home where I definitly use my iPhone the most. I bypassed and ignored the problem for quite some time, as enabling Flightmode and disabling it – would temporarily fix the problem. Another weird thing, was that my friend had the exact same iPhone model, and never had a problem with my home wifi network. However, after some time, I have had enough and decided to investigate. After googling around for a bit, the majority of posts I found suggested me to buy an AirPort Express which “worked on both macbooks and iphones”. Well my oh my, I would be suprised if Apple’s own products didn’t work on their own products! I also tried changing encryption on my Linksys WRT router, which didn’t change anything. However, changing both the SSID and wifi password on my router, fixed the problem – for that specific phone..

After recieving my new iPhone4 I was litterally in heaven as it would replace my rather slow and outdated (Yes, thank you Apple for stabbing your first european iPhone customers in their back!) Soon I noticed that I began having the same problem with this iPhone as well, and even worse – with other networks as well. Then it struck me, after quite a bit of puzzling of details. I realised that my iPhone 3G had been restored by a backup from my first iPhone 3G (as well as my iPhone4), which I had replaced because of a malfunction. After that, the problem evolved. My friend had never restored his iPhone 3G, and never had the problem.. Maybe there is a glitch in Apple‘s restore mechanism, which cause WiFi settings to get corrupt?

So I tried a very simple fix:

Settings → General → Reset → Reset Network Configuration

(PS! This will completely wipe out any network configuration, i.e networks, passwords… anything)

After re-adding the same networks once again, I’ve never had the same problem again. I did the same with my iPad with the same problem, and it is also working fine now! I hope this article helps out other lost souls with the same problem.

Tags: , ,

Clearing DNS cache in MacOS v10.6.5

So the other day, I was too lazy to wait for my DNS host to cron update my domains zone file. So what to do? You guessed right. I can do an oldschool hosts file hack. But wait, I already tried looking up the domain – and the earlier resolved IP is still in my DNS cache.

How to clear MacOS v10.6.5′s DNS cache? The following way (requires superuser, and your password):

enigma:~ vidarst$ sudo dscacheutil -flushcache
enigma:~ vidarst$

And that’s it!

Tags: , ,

Code Snippet test

Lets see how CodeSnippet works!

#include <stdio.h>
 
int main(void)
{
    printf("hello, world\n");
    return 0;
}