◆当blogは、Linuxサーバ構築する際の実際の設定手順を個人的メモとして記載しております。LinuC試験の役に立つ情報があるかも…?
[root@A]# dmesg | grep eth
eth0: registered as PCnet/PCI II 79C970A
eth0: link up
eth0: no IPv6 routers present
[root@A]# lspci
02:01.0 Ethernet controller: Advanced Micro Devices [AMD] 79c970 [PCnet32 LANCE] (rev 10)
[root@A]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:C9:99:4C
inet addr:192.168.0.55 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fec9:994c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3702 errors:0 dropped:0 overruns:0 frame:0
TX packets:2489 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:360938 (352.4 KiB) TX bytes:301017 (293.9 KiB)
Interrupt:75 Base address:0x2000
[root@A]# ifconfig eth0:0 192.168.0.56 netmask 255.255.255.0 up
[root@A]# ifconfig eth0:0
eth0:0 Link encap:Ethernet HWaddr 00:0C:29:C9:99:4C
inet addr:192.168.0.56 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:75 Base address:0x2000
[root@A]# arp
Address HWtype HWaddress Flags Mask Iface
192.168.0.21 ether E0:CB:4E:11:FC:EC C eth0
buffalo.setup ether 00:0D:0B:B6:0A:B6 C eth0
[root@A]# arp -n
Address HWtype HWaddress Flags Mask Iface
192.168.0.21 ether E0:CB:4E:11:FC:EC C eth0
192.168.0.1 ether 00:0D:0B:B6:0A:B6 C eth0
[root@A]# traceroute sentos5
traceroute to sentos5 (127.0.0.1), 30 hops max, 40 byte packets
1 sentos5.localdomain (127.0.0.1) 0.019 ms 0.011 ms 0.009 ms
[root@A]# traceroute -n sentos5
traceroute to sentos5 (127.0.0.1), 30 hops max, 40 byte packets
1 127.0.0.1 0.018 ms 0.009 ms 0.013 ms
[root@A]# tcpdump -i eth0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
22:50:53.721877 IP 192.168.0.55.ssh > 192.168.0.21.52146: P 2187861119:2187861235(116) ack 2768986704 win 7504
22:50:53.722047 IP 192.168.0.55.ssh > 192.168.0.21.52146: P 116:232(116) ack 1 win 7504
[root@A]# tcpdump -nli eth0 port 53
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 96 bytes
22:52:56.040693 IP 192.168.0.21.53094 > 192.168.0.1.domain: 17340+ A? www.nicovideo.jp. (34)
22:52:56.073466 IP 192.168.0.1.domain > 192.168.0.21.53094: 17340 1/2/1 A 202.248.110.243 (116)
[root@A]# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 sentos5.localdomain:2208 *:* LISTEN
tcp 0 0 *:nfs *:* LISTEN
[root@A]# netstat -i
Kernel Interface table
Iface MTU Met RX-OK RX-ERR RX-DRP RX-OVR TX-OK TX-ERR TX-DRP TX-OVR Flg
eth0 1500 0 8091 0 0 0 8978 0 0 0 BMRU
lo 16436 0 3180 0 0 0 3180 0 0 0 LRU
[root@A]# netstat -r
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.0.0 buffalo.setup 255.255.255.0 UG 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
default buffalo.setup 0.0.0.0 UG 0 0 0 eth0
[root@A]# nc 192.168.0.55 25
220 sentos5.localdomain ESMTP Postfix
[root@A]# nc -vz 192.168.0.55 1-1000
nc: connect to 192.168.0.55 port 1 (tcp) failed: Connection refused
nc: connect to 192.168.0.55 port 2 (tcp) failed: Connection refused
[root@A]# nc -vzu 192.168.0.55 1-1000
Connection to 192.168.0.55 111 port [udp/sunrpc] succeeded!
Connection to 192.168.0.55 161 port [udp/snmp] succeeded!
[root@A]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
[root@A]# route add default gw 192.168.0.1
[root@A]# route add -net 192.168.0.0 netmask 255.255.255.0 gw 192.168.0.1
[root@A]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 buffalo.setup 255.255.255.0 UG 0 0 0 eth0
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
default buffalo.setup 0.0.0.0 UG 0 0 0 eth0
[root@A]# ip route show
192.168.0.0/24 via 192.168.0.1 dev eth0
192.168.0.0/24 dev eth0 proto kernel scope link src 192.168.0.55
default via 192.168.0.1 dev eth0
[root@A]# iwconfig
lo no wireless extensions.
eth0 no wireless extensions.
sit0 no wireless extensions.
[root@A]# iwconfig wlan0
wlan0 No such device
[root@A]# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1 sentos5.localdomain sentos5 localhost.localdomain localhost
::1 localhost6.localdomain6 localhost6
[root@A]# cat /etc/nsswitch.conf
passwd: files ldap
shadow: files ldap
group: files ldap
hosts: files ldap dns
[root@A]# cat /etc/resolv.conf
nameserver 192.168.0.1
[root@A]# cat /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=sentos5.localdomain
[root@A]# ls -l /etc/sysconfig/network-scripts/*
-rw-r--r-- 3 root root 193 羌 2010 /etc/sysconfig/network-scripts/ifcfg-eth0
[root@A]# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
HWADDR=00:0c:29:c9:99:4c
NETMASK=255.255.255.0
IPADDR=192.168.0.55
GATEWAY=192.168.0.1
TYPE=Ethernet
[root@A]# cat /etc/hosts.allow
[root@A]# cat /etc/hosts.deny
[root@A]# tracepath 192.168.0.55
1: 192.168.0.55 (192.168.0.55) 0.079ms pmtu 16436
1: 192.168.0.55 (192.168.0.55) 0.021ms reached
Resume: pmtu 16436 hops 1 back 1
[root@A]# cat /etc/issue
CentOS release 5.3 (Final)
Kernel \r on an \m
[root@A]# cat /etc/issue.net
CentOS release 5.3 (Final)
Kernel \r on an \m
[root@A]# cat /etc/motd
[root@A]# wall "Test Message !"
Broadcast message from root (pts/2) (Wed Jan 5 23:28:43 2011):
Test Message !
[root@A]# shutdown -k now "Test Message!!!"
Broadcast message from root (pts/2) (Wed Jan 5 23:29:23 2011):
Test Message!!!
The system is going down to maintenance mode NOW!
Shutdown cancelled.
COMMENT