2015年7月16日 星期四

Slow ubuntu ssh/telnet login prompt



in this discussion:

http://ubuntuforums.org/showthread.php?t=1842371

vi /etc/nsswitch.conf
find line “hosts: files mdns4_minimal [NOTFOUND=return] dns mdns 4 mdns”
change to
"hosts: files dns"

the login prompt will show up instantly

also, you can  move /etc/motd  away to disable the welcome message of telent

2015年3月29日 星期日

Windows XP windows size default is too small



The default vaule is 64K, it will impact the throughput test.

You need to modify the value if you want to get good throughput test result.

2015年3月8日 星期日

pptpd debug


start pptpd in debug mode:
pptpd -d

read the debug log in syslog:
cat /var/log/syslog

[problem]
connection failed, and debug message show "mppe required but peer refused" :
you need to force the client to use mppe encryption or close the mppe encryption option on server.

pptp client can't get dns server ip:
set the ms-dns option on the server side, let the client can get ip.


2015年1月4日 星期日

Packet out of order problem


The IP header is 32 bytes in normal situation.
If it is not, the packet ID's address we read may be wrong, we will got wrong ID and cause out of order.

This will cause serious speed impact because the client will ask host to transfer the right packet again.

It can be solved by enable the IP header realigned to 4 byte features on you wireless driver. (It should be enable by default)

2014年9月9日 星期二

Linux conntrack tables


you can type following command to check current conntrack table
cat /proc/net/ip_conntrack

you can set each protocol's timeout value in (normal is 30s)
/proc/sys/net/ipv4
/proc/sys/net/ipv6

On 2.6.36, the icmp's conntrack will still alive even the target reply the icmp ack,
this may cause some trouble ( like you set the firewall or routing path ) , I recommand you clean the conntrack table (you can use conntrack-tool to do it) after setting the routing path or firewall.

reference:
http://www.faqs.org/docs/iptables/theconntrackentries.html

2014年2月26日 星期三

Error: linux/config.h: No such file or directory 錯誤


According to this guy,

http://allanh.pixnet.net/blog/post/36588057-%5Bubuntu%5D--error%3A-linux-config.h%3A-no-such-file-or-directory

 linux have remove linux/config.h since version 2.6.19, replace with linux/autoconf.h.

In order to solve this problem, we just need to replace linux/config.h to linux/autoconf.h

Done! easy.

2014年2月23日 星期日

Installing PPPOE server on linux system with VM. 利用VM在linux系統上安裝 PPPOE server

1. install

apt-get install ppp
apt-get install pppoe

or

yum install ppp
yum install pppoe

2. config

#if there is no /etc/ppp/pppoe-server-options
cp /etc/ppp/options /etc/ppp/pppoe-server-options

you can see detail configs in http://wayne0225.blogspot.tw/2012/07/pppoe-server-on-ubuntu.html

3. Execute

#*** need to execute every time when you reboot
# config distributed address, # eth0 is the nic which client will dial in.
pppoe-server -I eth0 -L 192.168.1.1 -R 192.168.1.10-200
# -L IP : interface's ip (gateway)
# -R IP: distributed ip range

# enable the fordwarding function on your linux system
echo "1">/proc/sys/net/ipv4/ip_forward

porting packet to internet accessable nics
# eth0 is your outgoing interface
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

4.with VM

Sometimes you want to test your cpe's pppoe function but with the ISP's corporation, and VM is easy accessible, portable and easy recovery tool. Below, I use vmware as my virtualization tool.
first topology (not working)
My purpose is start two vm, vm1 as pppoe server with nat, vm2 as client, vm1 has two nics, first nic for internet access throught the vm's nat, the second nic used to connected with vm2.
But I found that the packet from vm2 can't go throught the VM NAT, it will be blocked, and I don't know why.
Using real nic as nat server despite vm's nat function (working)
So, I use my physical nic's nat function, and bridge VM1 NIC1 to host pc's NIC2, and it works, the packet can go through now, it's weird, but it works.

5. Trouble shooting:

if your packet is blocking by firewall, clear iptables first
iptables -F
iptables -X
iptables -Z