Thursday, September 25, 2014

SuSE Linux Box Network Configuration

/etc/hosts

/etc/HOSTNAME

/etc/sysconfig/network/ifcfg-eth0
BOOTPROTO='static'
BROADCAST=''
ETHTOOL_OPTIONS=''
IPADDR='10.10.10.10/30'
MTU=''
NAME='82540EM Gigabit Ethernet Controller'
NETWORK=''
REMOTE_IPADDR=''
STARTMODE='auto'
USERCONTROL='no'

/etc/resolv.conf
/etc/sysconfig/network/routes
/etc/sysconfig/network/ifroute-eth0
10.23.30.128/25 10.10.10.1 - eth0

/etc/networks

/etc/nsswitch.conf

/etc/nscd.conf

/etc/init.d/network

/etc/sysconfig/sysctl.conf <- br="" forward="" ip="">echo 1 > /proc/sys/net/ipv4/ip_forward
#sysctl -a | grep ip_forward
net.ipv4.ip_forward = 1
sysctl -p

route add default gw 10.10.10.254 eth0

iptables -P INPUT DROP
iptables -P FORWARD ACCEPT
iptables -P OUTPUT ACCEPT

iptables-save > iptables_current
iptables-restore  iptables_current

iptables -nvL

/etc/init.d/boot.local
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -i eth0 -p icmp -m icmp --icmp-type 8 -j ACCEPT
iptables -A INPUT -i eth0 -p tcp -m multiport --dports 21,22,80,5060,8080,2100,30000:30100 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A INPUT -i eth0 -p udp -m multiport --dports 53,20,5060,8080,2100 -m state --state NEW,ESTABLISHED -j ACCEPT
iptables -A OUTPUT -o lo -j ACCEPT
iptables -A OUTPUT -o eth0 -p icmp -m icmp --icmp-type 8 -j ACCEPT

mount "SUSE Enterprise Linux 11 SP3 DVD x86_64"
mount /dev/cdrom /media
cd /media/suse/x86_64
zypper install vsftpd

vi /etc/vsftpd.conf
write_enable=YES
dirmessage_enable=YES
nopriv_user=ftpsecure
ftpd_banner="Welcome to My FTP Server"
ls_recurse_enable=YES
#deny_email_enable=YES
#banned_email_file=/etc/vsftpd.banned_emails
#hide_ids=YES
local_enable=YES
local_umask=022
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
local_max_rate=1024000
anonymous_enable=NO
anon_world_readable_only=NO
anon_upload_enable=NO
#anon_umask=022
anon_mkdir_write_enable=NO
anon_other_write_enable=NO
#chown_uploads=YES
#chown_username=whoever
#anon_max_rate=150
syslog_enable=NO
log_ftp_protocol=YES
#xferlog_enable=YES
vsftpd_log_file=/var/log/vsftpd.log
#xferlog_std_format=NO
#xferlog_file=/var/log/xfer.log
dual_log_enable=YES
#setproctitle_enable=YES
connect_from_port_20=YES
#idle_session_timeout=600
#data_connection_timeout=120
#async_abor_enable=YES
ascii_upload_enable=YES
ascii_download_enable=YES
pasv_enable=YES
pam_service_name=vsftpd
listen=YES
ssl_enable=NO
pasv_min_port=30000
pasv_max_port=30100
#local_root=/public_html
use_localtime=YES
max_clients=50

vi /etc/vsftpd.chroot_list
root

Change NIC name to em1 to eth0 on SuSE Linux Box

#ifconfig | grep HW
em1 Link encap:Etherenet

#ls /etc/udev/rules.d | grep biosdevname.rules
71-biosdevname.rules

#cat /boot/grub/menu.lst
kernel /vmlinuz-3.0.76-0.11-default root=/dev/disk/by-id/ata-VBOX_HARDDISK_VBe5a986d1-1dd7c0b3-part4 resume=/dev/disk/by-id/ata-VBOX_HARDDISK_VBe5a986d1-1dd7c0b3-part3 splash=silent crashkernel=256M-:128M showopts vga=0x314
add "biosdevname=0" at the end

#cp /etc/udev/rules.d/70-persistent-net.rules /etc/udev/rules.d/70-persistentnet.rules.old
#cat < /dev/null > /etc/udev/rules.d/70-persistent-net.rules

#mv /etc/sysconfig/network/ifcfg-em1 /etc/sysconfig/network/ifcfg-eth0
#mv /etc/sysconfig/network/ifcfg-em2 /etc/sysconfig/network/ifcfg-eth1

Create File with Specified File Size on Linux

Linux, Create File With Content & Specified Size
#dd if=/dev/urandom of=3MB bs=1 count=0 seek=3M
#dd if=/dev/urandom of=5MB bs=1 count=0 seek=5M
#dd if=/dev/urandom of=25MB bs=1 count=0 seek=25M
#dd if=/dev/urandom of=50MB bs=1 count=0 seek=50M
#dd if=/dev/urandom of=100MB bs=1 count=0 seek=100M
#dd if=/dev/urandom of=1GB bs=1 count=0 seek=1G

Linux, Create File with No Content & Specified Size
#dd if=/dev/zero of=1GB bs=1 count=0 seek=1G

Tuesday, June 24, 2014

Virtualbox Support 8 NICs for VM Guest

Virtualbox supports up to eight network cards. If you look into the *.vbox you will see that there are already preconfigured but disabled. Unfortunately inside the VBox GUI we could only configure up to four. I will show how to get and configure the other.
You have to use VBoxManage to get the other network cards. After the option will always be the NIC Number count one to eight. Here I will use five and the name of the machine that will be configured is “SFS1”.

Set Mode and enable NIC

When a Mode is set the NIC will be enabled.

C:\Program Files\Oracle VM VirtualBox>VBoxManage.exe
  1. Set NIC five to Host-Only Mode and User vboxnet0 (Initially existing Host-Only Net)
    VBoxManage modifyvm SFS1 --nic5 hostonly
    VBoxManage modifyvm SFS1 --hostonlyadapter5 "vboxnet0"
     
  2. Set NIC five to Bridge "Intel(R) 82567LM Gigabit Network Connection"
    VBoxManage modifyvm SFS1 --nic5 bridged
    VBoxManage modifyvm SFS1 --bridgeadapter5 "Intel(R) 82567LM Gigabit Network Connection"
     
  3. Set NIC to NAT Mode
    VBoxManage modifyvm SFS1 --nic5 nat
     
  4. Use the internal VM net “test01”
    VBoxManage modifyvm SFS1 --nic5 intnet
    VBoxManage modifyvm SFS1 --intnet5 "test01"

Configuring NIC

  • To use VLAN and some other things in VMs the Promiscuous mode have to be enabled
    VBoxManage modifyvm SFS1 --nicpromisc5 allow-all
     
  • Use other hardware type (Intel Pro/1000 MT Server)
    VBoxManage modifyvm SFS1 --nictype5 82545EM
     
  • Dis/connect cable
    VBoxManage modifyvm SFS1 --cableconnected5 off 
    VBoxManage modifyvm SFS1 --cableconnected5 on

Friday, June 6, 2014

Activate Windows Server 2008 R2 Enterprise without Internet Connection



Recently, I faced a situation in which I had to activate Windows Server 2008 R2 Enterprise which didn’t have internet connection. In the earlier days of Windows 2003 there was a Phone Activation option within the wizard. However, in the current edition Windows 2008 onwards the option doesn’t exist.
I am going to show you the steps involved in quickly activated Windows Server 2008 onwards over the Phone using the following command line parameters:
  • Start –> Run –> Command Prompt right click and “Run as a administrator”
  • Type the following command to retrieve the Product Installation id slmgr.vbs /dti (A pop-up windows will appear with a long string of digits)
  • Call the Microsoft activation centers as per your locations from this Microsoft Activation Centers link
    • I used the India number 1800 11 11 00 or 1800 102 1100
  • Provide the Installation ID to the customer care representative and they will provide a Confirmation Number (A long sting of numbers)
  • Type slmgr.vbs /atp (without <>) at the command prompt and you will receive a pop-up that your Windows have been activated successfully
  • To confirm your activation type the following command slmgr.vbs /dli
Go to your Server Manager and you will be able to see the Windows Server 2008 R2 activated

Monday, May 12, 2014

Huawei Quidway Switch 5300 Series

The S5352C-EI is a case-shaped device with a 1 U high chassis, provided in a
- limited version LI - provides various Layer-2 functions
- standard version SI - supports Layer-2 functions and basic Layer-3 functions
- enhanced version EI - supports all routing protocols and features
- advanced version HI - supports all routing protocols and features and MPLS, hardware OAM.

LS-S5352C-EI Overview

• Power: need to purchase additional power LS5M100PWA00 or LS5M100PWD00
• Non-POE Switch
• Layer 3 Ethernet Switch
• Ports: 48 GE
• Extended Interface Card Slot: 1
• Software: Enhanced Version
• Stackable switch
• Powerful Service Support
• High Reliability
• Security and QoS
Quidway S5300 series gigabit switches are new generation Ethernet gigabit switches that meet the requirements for high-bandwidth access and Ethernet multi-service convergence, providing powerful Ethernet functions for operators and enterprise customers. Based on the new generation high-performance hardware and Huawei Versatile Routing Platform (VRP), the S5300 features large capacity and gigabit interfaces of high density, provides 10G uplinks, meeting the requirements for the 1G and 10G uplink devices of high density. The S5300 can meet the requirements of multiple scenarios such as service convergence on campus networks and Intranets, the access to the IDC at a rate of 1000 Mbit/s, and the access to computers at a rate of 1000 Mbit/s on Intranets.