1 / 11

網路伺服器應用 Linux Server

網路伺服器應用 Linux Server. Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw http://www.cse.dlit.edu.tw/~andres. Chapter 9 多 IP 與 Router 的架設. 9-1 多 IP 的架設. 網路界面卡 ( Network Interface Card, NIC ) 實體界面 eth0 - 網路卡代號

rafe
Download Presentation

網路伺服器應用 Linux Server

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 網路伺服器應用Linux Server Andres, Wen-Yuan Liao Department of Computer Science and Engineering De Lin Institute of Technology andres@dlit.edu.tw http://www.cse.dlit.edu.tw/~andres

  2. Chapter 9多 IP 與 Router 的架設

  3. 9-1 多 IP的架設 • 網路界面卡( Network Interface Card, NIC ) • 實體界面 • eth0 - 網路卡代號 • 網路界面( Interface ) • 連線的虛擬界面 • Interface 必需要架構在 NIC 之上 • eth0:0 - 第一個虛擬界面代號 • eth0:1 - 第二個虛擬界面代號

  4. command line 手動設定 • ifconfig <device> <ip> netmask <nip> broadcast <bip> <action> • ifconfig eth0:0 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255 up • ifconfig eth0 • ifconfig eth0:0 • ping -c 3 192.168.1.2 • ping -c 3 192.168.0.2 • 每次開機你都得在手動的輸入一次 • 除非寫到 /etc/rc.d/rc.local

  5. 裝置設定檔設定ifcfg-eth0:0 DEVICE=eth0:0ONBOOT=noBOOTPROTO=staticIPADDR=192.168.0.2NETMASK=255.255.255.0 NETWORK=192.168.0.0BROADCAST=192.168.0.255 • ifup eth0:0

  6. 9-2 Router 的架設

  7. command line 手動設定

  8. 裝置設定檔設定 • 設定網路介面,其中 eth0 為 192.168.1.2, eth0:0 為 192.168.0.2 2. 觀察路由情況: route 3. 啟動 IP FORWARD 項目: echo 1 > /proc/sys/net/ipv4/ip_forward 4.1 設定 192.168.1.0 網域的 client • gateway:192.168.1.2 4.2 設定 192.168.0.0 網域的 client • gateway:192.168.0.2

  9. ifcfg-eth0, ifcfg-eth0:0 • DEVICE=eth0 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.1.2 NETMASK=255.255.255.0 NETWORK=192.168.1.0 BROADCAST=192.168.1.255 GATEWAY=192.168.1.2 • DEVICE=eth0:0 ONBOOT=no BOOTPROTO=static IPADDR=192.168.0.2 NETMASK=255.255.255.0 NETWORK=192.168.0.0 BROADCAST=192.168.0.255 • ifup eth0 ; ifup eth0:0 ifconfig eth0; ifconfig eth0:0

  10. 測試 Router 工作 1. Client 端的測試(192.168.1.11 ): • ping 192.168.1.2 • ping 192.168.0.2 • ping 192.168.0.11 2. Server 端的修改 • echo 0 > /proc/sys/net/ipv4/ip_forward 3. Client 端的測試 (192.168.1.11) • ping 192.168.0.11 4. 恢復 Linux Router : • echo 1 > /proc/sys/net/ipv4/ip_forward 5. 用另一部 Linux 主機看一下結果 ( IP 192.168.0.11 ) • ping -c 3 192.168.1.11

More Related