April 20, 2015

DNS notes: sub domain delegation with global forwarders

When you have global forwarders configured in your named configuration, sub domain delegation does not work as expected. Lookup's for sub domains of zones (even if you are authoritative) get forwarded to forwarders.

To disable forwarders for the zones, you are authoritative for - you need to add a null forwarders list in to your zone configuration

zone "mydomian.test" in {
    type master;
    file "master/named.test";
    allow-update { "localhost"; };
    forwarders { }; 
};

April 13, 2015

Debian static IP configuration: Wifi adapter

Following steps illustrate configuration of static IP to Wi-Fi connection on Debian Wheezy

Static configuration for the wifi interface is added into /etc/network/interfaces

First you need to generate 256 bit Pre-Shared Key (PSK) from passphrase for your WIFI connection as below

$ sudo wpa_passphrase MY_SSID
# reading passphrase from stdin
xxxxxx123   <= type in the passphrase
network={
    ssid="MY_SSID"
    #psk="xxxxxx123"
    psk=c2ddfd959c6febdc4aac1f3575ded17278a0749d9997d08c07d03a241a812e1c
}


in above example MY_SSID is wireless SSID and 'psk' is the 256-bit pre-shared key calculated from provided 'passphrase'

Now you can add this information into 'interfaces' file as below

$ tail /etc/network/interfaces
# for wifi connection
auto wlan0
iface wlan0 inet static
    address 192.168.0.200
    netmask 255.255.255.0
    gateway 192.168.0.1
    dns-nameservers 192.168.0.1
    wpa-ssid MY_SSID
    wpa-scan-ssid 1
    wpa-psk c2ddfd959c6febdc4aac1f3575ded17278a0749d9997d08c07d03a241a812e1c


If your SSID is configured to be hidden, then you need 'wpa-scan-ssid' to be set 1

Once interfaces file is properly configured, you can bring up interface using "ifup wlan0"

Check interface details with 'iw' (or) iwconfig as below

$ sudo iw wlan0 link
Connected to
xx:xx:xx:xx:xx:xx (on wlan0)
    SSID: MY_SSID
    freq: 2427
    RX: 73561328 bytes (398315 packets)
    TX: 8602925 bytes (32204 packets)
    signal: -39 dBm
    tx bitrate: 39.0 MBit/s MCS 10

    bss flags:    short-slot-time
    dtim period:    0
    beacon int:    100


$ sudo iwconfig wlan0
wlan0     IEEE 802.11bgn  ESSID:"MY_SSID" 
          Mode:Managed  Frequency:2.427 GHz  Access Point: xx:xx:xx:xx:xx:xx  
          Bit Rate=39 Mb/s   Tx-Power=20 dBm  
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=70/70  Signal level=-38 dBm 
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:6  Invalid misc:877   Missed beacon:0


Note: Disable avahi-daemon and also change hosts line in nsswitch.conf as below

$ grep hosts: /etc/nsswitch.conf
#hosts:          files mdns4_minimal [NOTFOUND=return] dns mdns4
hosts:          files dns


April 2, 2015

tcpdump: bpf_load: genmajor failed: A file or directory in the path name does not exist

If you are getting above error, while trying to run tcpdump via sudo on an AIX host, it's due to environment variable ODMDIR being not set

$env|grep ODMD
ODMDIR=/etc/objrepos
By default sudo will reset your environment and ODMDIR is not avilable in sudo session. Hence commands which require ODMDIR ( ex: cfgmgr, savebase etc) fail.

To resolve this either keep all user environment via 'sudo -E' (or) update sudoers to keep ODMDIR variable (preferred)

Defaults env_keep +="ODMDIR"

AIX rpm dependency

AIX filesets/packages information is stoted in ODM, however you could install packages in rpm format as well on AIX.  RPM uses it's own database to store information on installed packages.

To interlink the shared libraries from AIX and resolve dependencies for rpm's - AIX uses a virtual/psuedo rpm called AIX-rpm

$ rpm -q AIX-rpm
AIX-rpm-6.1.5.0-6

Major version of this rpm is based on oslevel of AIX. This rpm has nofiles, but it provides all installed libraries,shells to resolve dependencies. You can verify this via

$ rpm --provides -q AIX-rpm

Whenever new LPP filesets are installed/updated, this information in the psuedo rpm needs to be updated. This is done via a script - "/usr/sbin/updtvpkg"

If you are running into some issues installing rpm's with respect to missing shared libraries, it's possible that you need to re-generate new AIX-rpm. Depending on the installed software this script could take long time to complete