...

ローカルループ

by user

on
Category: Documents
8

views

Report

Comments

Transcript

ローカルループ
TCP/IPネットワークの管理
ネットワークインターフェイスの種類
lo: ローカルループバック
UNIXはネットワークが標準。よってネットワークに継って
いなくてもネットワークに継っているようになっていないと
都合悪い。
→ダミーアドレス。自分自身を指す。自分だけが
構成員の仮想的なネットワークを持ち、
プライベイトアドレスを仮想的にふってある。
ethn:イーサネット
前回説明した、イーサネットの規格をサポートした
ネットワークインターフェース用。
モデム時代:PPPn
ネットワークインターフェイスドライバーの指定
ドライバー:UNIXとインターフェイスの動作の
翻訳を担う。NIC(ネットワークインターフェイスカード)
ごとに作成が必要。
/etc/modules.conf
alias eth0 eepro100
実体:モジュールの読み込み。
モジュール:様々な付加機能を担う。
必要な時だけ読み込むことでメモリーを節約。
ドライバーもモジュールとして読み込み。
インターフェイスの設定制御の階層構造
/etc/sysconfig/network
ホスト名、ゲイトウェイ、など
設定値
/etc/sysconfig/network-scripts/ifcfg-<device>
特定のインターフェイスに
設定すべき情報。IPアドレスとか。
ifup/ifdown <device>
← 起動/停止
ethn
ifconfig <device> up/down
実体
コマンド列
(マクロ)
ifconfig
ネットワークインターフェイスの状態を報告する機能もあ
eth0
Link encap:Ethernet HWaddr 00:90:99:7E:9B:E3
inet addr:192.168.123.188 Bcast:192.168.123.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MTU:1500 Metric:1
RX packets:1106 errors:0 dropped:0 overruns:0 frame:0
TX packets:4968 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
Interrupt:11 Base address:0x8000
lo
Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:823 errors:0 dropped:0 overruns:0 frame:0
TX packets:823 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
netstat
ポート間の接続状況などをレポート
Active Internet connections (w/o servers)
Proto Recv-Q Send-Q Local Address
Foreign Address
State
tcp4
0
0 laputa:5680
laputa:32771
ESTABLISHED
tcp4
0
0 laputa:5680
laputa:32769
ESTABLISHED
tcp4
0
0 laputa:32771
laputa:5680
ESTABLISHED
tcp4
0
0 laputa:32769
laputa:5680
ESTABLISHED
tcp4
0
0 192.168.123.188:32774 nausicaa.phys.ch:telnet ESTABLISHED
telnet
ポート番号
32774
192.168.123.188
nausicaa
route
ルーティング設定コマンド
パケットが全世界に流れても困るが
相手に届かないのも困る。
192.168.1.x
LAN
eth1
192.168.1.x→192.168.1.y
133.91.80.x
×
192.168.1.x→133.91.80.y
インターネット
eth1
必要なパケットだけを流す。
routeコマンドの仕様
route add default gw 133.91.80.5 eth0
とりあえず、eth0に送ること。先にはgwがある。
route add -net 192.168.1.0 255.255.255.0 eth1
192.168.1.xはeth1に送れ。
route add -net 133.91.80.0 255.255.255.0 eth0
133.91.80.53はeth0に送れ。
route
現在の状況をレポート
Kernel IP routing table
Destination Gateway
Genmask
Flags Metric Ref Use Iface
192.168.123.0 *
255.255.255.0 U
0
0
0 eth0
127.0.0.0
*
255.0.0.0
U
0
0
0 lo
default
192.168.123.254 0.0.0.0
UG 0
0
0 eth0
ゲートウェイ
192.168.123.254
192.168.123.0
127.0.0.0
インターネットへ
tcpdump
[root@laputa /root]# tcpdump
tcpdump: listening on eth0
02:08:12.769974 192.168.123.188.4445 > 192.168.128.255.44
02:08:12.771422 192.168.123.188.32771 > eagle.asahi-net.or.j
02:08:12.774116 eagle.asahi-net.or.jp.domain > 192.168.123.1
02:08:12.774797 192.168.123.188.32771 > eagle.asahi-net.or.j
02:08:12.777410 eagle.asahi-net.or.jp.domain > 192.168.123.1
02:08:13.769969 192.168.123.188.4445 > 192.168.128.255.44
02:08:14.769956 192.168.123.188.4445 > 192.168.128.255.44
02:08:15.769708 192.168.123.188.4445 > 192.168.128.255.44
8 packets received by filter
0 packets dropped by kernel
流れた来たパケットの属性を列挙
ping
パケットを流してみてちゃんと届くかどうかをチェック
[root@laputa /root]# ping www.yahoo.co.jp
PING www.yahoo.co.jp (211.14.13.65) from 192.168.123.188 : 56(84) bytes of data.
64 bytes from w11.yahoo.co.jp (211.14.13.65): icmp_seq=0 ttl=53 time=3.035 msec
64 bytes from w11.yahoo.co.jp (211.14.13.65): icmp_seq=1 ttl=53 time=2.562 msec
64 bytes from w11.yahoo.co.jp (211.14.13.65): icmp_seq=2 ttl=53 time=3.091 msec
64 bytes from w11.yahoo.co.jp (211.14.13.65): icmp_seq=3 ttl=53 time=2.791 msec
64 bytes from w11.yahoo.co.jp (211.14.13.65): icmp_seq=4 ttl=53 time=2.743 msec
--- www.yahoo.co.jp ping statistics --5 packets transmitted, 5 packets received, 0% packet loss
round-trip min/avg/max/mdev = 2.562/2.844/3.091/0.200 ms
tracerroute
経路情報探索
[root@laputa /root]# traceroute 133.91.80.53
traceroute to 133.91.80.53 (133.91.80.53), 30 hops max, 38 byte packets
1 192.168.123.254 (192.168.123.254) 0.362 ms 0.299 ms 2.179 ms
2 tkynib1.asahi-net.or.jp (211.13.140.74) 1.897 ms 1.861 ms 2.947 ms
3 tkynip-ge1.asahi-net.or.jp (211.13.140.30) 1.997 ms 2.168 ms 2.531 ms
4 tkyti2-v8.asahi-net.or.jp (202.224.33.209) 2.104 ms 2.013 ms 2.419 ms
5 tkyni2.asahi-net.or.jp (202.224.32.89) 2.043 ms 2.026 ms 2.980 ms
6 kddni2.asahi-net.or.jp (202.224.32.49) 2.458 ms 2.362 ms 2.451 ms
7 as4713.nspixp2.wide.ad.jp (202.249.2.111) 2.471 ms 3.482 ms 2.469 ms
8 210.163.252.182 (210.163.252.182) 2.897 ms 2.840 ms 2.720 ms
9 210.254.185.34 (210.254.185.34) 4.498 ms 4.347 ms 3.054 ms
10 210.254.187.17 (210.254.187.17) 2.917 ms 3.030 ms 2.725 ms
11 210.254.187.46 (210.254.187.46) 2.981 ms 2.869 ms 2.786 ms
12 210.227.226.28 (210.227.226.28) 3.637 ms 4.331 ms 3.139 ms
13 210.190.160.6 (210.190.160.6) 3.540 ms 3.346 ms 5.980 ms
14 211.0.220.90 (211.0.220.90) 24.907 ms 24.973 ms 24.946 ms
15 zip.cc.chuo-u.ac.jp (133.91.40.2) 25.955 ms 25.952 ms 25.608 ms
16 133.91.8.6 (133.91.8.6) 25.316 ms 25.999 ms 25.930 ms
17 nausicaa.phys.chuo-u.ac.jp (133.91.80.53) 25.714 ms 30.262 ms 25.719 ms
arp
IPとMACの対応
nausicaa:~# /sbin/arp -a
Address
HW type
HW address
Flags Mask
133.91.80.1
10Mbps Ethernet 00:02:B3:88:5D:8A
C
*
neat ネットワークの設定のためのGUI
デバイスタブ
→イーサネットデバイスウィンドウ
IP、ゲイトウェイ、ネットマスクなどを設定。
ハードウェアタブ
ハードウェア設定
DNSタブ
後述
ホストタブ
ホスト名設定
Fly UP