2010年8月5日 星期四

Network

///////////////////////////
測網路通不通
telnet ip port
ie. telnet www.google.com.tw 80

/////////////////////////
The firwall
{{{
in the /etc/init.d/iptables
}}}

///////////////////////////////
Look the iptble content
{{{
[root@localhost test]# iptables -L -n |
}}}


//////////////////
Look the route information
{{{
[root@localhost rosePC]# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.200.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
0.0.0.0 192.168.200.254 0.0.0.0 UG 0 0 0 eth0
}}}

/////////////////////
Look the package
{{{
[root@localhost rosePC]# tcpdump
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
10:25:07.641993 IP 192.168.200.80.61604 > 239.255.255.250.ws-discovery: UDP, length 993
10:25:07.642419 IP 192.168.200.227.37423 > dns.sinica.edu.tw.domain: 3720+ PTR? 250.255.255.239.in-addr.arpa. (46)
}}}

///////////////////
Look the connection
{{{
[root@localhost rosePC]# netstat -tnlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2558/portmap
tcp 0 0 0.0.0.0:657 0.0.0.0:* LISTEN 2595/rpc.statd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 2819/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2839/sendmail: acce
tcp 0 0 :::80 :::* LISTEN 8331/httpd
tcp 0 0 :::22 :::* LISTEN 2808/sshd
}}}


//////
查看問題:
http://linux.vbird.org/linux_server/0140networkcommand.php#route

/////
查網卡
ifconfig
{{{
eth0 Link encap:Ethernet HWaddr 00:24:81:95:21:33
inet addr:192.168.200.227 Bcast:192.168.200.255 Mask:255.255.255.0
inet6 addr: fe80::224:81ff:fe95:2133/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5034520 errors:0 dropped:0 overruns:0 frame:0
TX packets:3121901 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2409215406 (2.2 GiB) TX bytes:926613291 (883.6 MiB)
Interrupt:66 Memory:f3000000-f3010000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:6679 errors:0 dropped:0 overruns:0 frame:0
TX packets:6679 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:7561716 (7.2 MiB) TX bytes:7561716 (7.2 MiB)

}}}

沒有留言:

張貼留言