Monday, December 22, 2014

bootup ubuntu-server-14.10 from pxe

step 1.
download netboot
wget -r --no-parent http://archive.ubuntu.com/ubuntu/dists/utopic/main/installer-i386/current/images/netboot/

step 2,
move netbook to /tftpboot/

step 3,
update /etc/dhcp/dhcpd.conf

subnet 192.168.32.0 netmask 255.255.255.0 {
  range 192.168.32.2 192.168.32.254;
  option routers 192.168.32.1;
  option domain-name-servers 192.168.32.1;
  filename "/netboot/pxelinux.0";
}

step 4.
power on the PC and choose boot from pxe option.

that's almost all.

bootup kali fro pxe

Bootup kali from pxe is almost like the way in bt5r3.

The difference lists below,

/tftpboot/pxelinux.cfg/default

TIMEOUT 100
DEFAULT kali
PROMPT 1
DISPLAY /isolinux.msg

LABEL kali
  KERNEL kali/install/vmlinuz
  APPEND initrd=kali/install/initrd.gz BOOT=install boot=install nopersistent rw quiet vga=0x317 netboot=nfs nfsroot=192.168.32.1:/tftpboot/kali

By the way, this time my experiment is working on vmware fusion to test this function, during the experiment, the vmware fusion is looking for ldlinux.c32 instead pxelinux.0, so my workaround is to copy a ldlinux.c32 to /tftpboot.
( In kali, ldlinux.c32 is in /usr/lib/syslinux/. )

Troubleshoot,
If the monitor compliant resolution out of range, try to change the vga option, for example vga=0x314.

Reference
http://linuxandfriends.com/vga-modes-used-linux/

Wednesday, December 17, 2014

28232 and 64511

28232 is a magic number.
it is different between 32768 and 61000.
32768 and 61000 is usually the definition of /proc/sys/net/ipv4/ip_local_port_range

so the whole story is that when i wrote a tcp client, i found that the maximum connection the tcp client created is always 28232, so i searched this number in google and found the reason.

The work around is
check the current definition first,
> cat /proc/sys/net/ipv4/ip_local_port_range

Change the definition
> echo "net.ipv4.ip_local_port_range = 1024 65535" >> /etc/sysctl.conf
> sysctl -p

After this setting, the maximum connection created by a tcp client will be 64511 - another magic number.

Reference:
http://www.cnblogs.com/yoleung/articles/1288568.html