Study Area VBird 20030627 IP netmask IP A
淺談網路管理 Study Area 教學團隊 VBird 2003/06/27
網路基礎觀念 • IP, netmask 與IP種類及取得方式 – 常見的網域分類: A Class : 0 xxxxxxxx. xxxx==>開頭是 |network|-----host------| B Class : 10 xxxxxxxx. xxxx==>開頭是 |----network-----|------host------| C Class : 110 xxxxxxxx. xxxx==>開頭是 |-----network-----|-host--| 0 10 110
網路基礎觀念 • IP, netmask 與IP種類及取得方式 – 子網域 192. 168. 0. 0/24 再細分 • 192. 168. 0. 0/25 ? ? – 192. 168. 0. 0000 – |-network--|--h--| • 192. 168. 0. 128/25 ? ? – 192. 168. 0. 10000000 – |-network--|--h--| • 上面兩個 Broadcast 與 network 各為多少?
網路基礎觀念 • IP, netmask 與IP種類及取得方式 – IP 的種類 • Public IP :可直接與 Internet 溝通 • Private IP :私有路有不可與 Internet 直接連接 – A Class: 10. 0 - 10. 255 – B Class: 172. 16. 0. 0 - 172. 31. 255 – C Class: 192. 168. 0. 0 - 192. 168. 255
Linux 網路基本設定檔 • IP 的相關設定 – 網路卡: • dmesg • lsmod, modprobe, 模組(驅動程式)編譯, /etc/modules. conf • /etc/sysconfig/network-scripts/ifcfg-ethn (n=0, 1, 2. . ) – – – – DEVICE=eth 0 BOOTPROTO=static BROADCAST=192. 168. 10. 255 IPADDR=192. 168. 10. 30 GATEWAY=192. 168. 10. 253 NETMASK=255. 0 NETWORK=192. 168. 10. 0 ONBOOT=yes
Linux 網路基本設定檔 • IP 的相關設定 – 檔案方式修改 IP • vi ifcfg-eth 0 • ifup eth 0 • ifdown eth 0 – 指令方式修改 IP • ifconfig eth 0 192. 168. 1. 1 netmask 255. 0 up • ifconfig eth 0 down
Linux 網路基本設定檔 • 主機名稱的相關設定 – /etc/sysconfig/network – /etc/hosts • 127. 0. 0. 1 localhost. localdomain – /etc/resolv. conf • nameserver 168. 95. 1. 1
Linux 開放網路服務前的 作 • 門窗關了沒? – 怎麼知道有 daemon 在 LISTEN ? • netstat, nmap – 如何關閉? • Stand alone : /etc/rc. d/init. d/* • super daemon : /etc/xinetd. d • netstat + kill – 如何開機時不啟動? • ntsysv, chkconfig, run-level
- Slides: 49