1 / 17

CS4231 Local Area Networks HW2 – PC-Based Bridge

CS4231 Local Area Networks HW2 – PC-Based Bridge. Overview. LAN seg. 1. LAN seg. 2. Summary. 目的 連接 LAN1 與 LAN2 Frame forwarding Frame filtering Hint Data link layer socket programming Library: libpcap libnet. Bridge. Layer 2 network device Connect 2 LAN seg.

cicero
Télécharger la présentation

CS4231 Local Area Networks HW2 – PC-Based Bridge

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. CS4231Local Area NetworksHW2 – PC-Based Bridge

  2. Overview LAN seg. 1 LAN seg. 2

  3. Summary • 目的 • 連接LAN1與LAN2 • Frameforwarding • Framefiltering • Hint • Data link layer socket programming • Library: • libpcap • libnet

  4. Bridge • Layer 2 network device • Connect 2 LAN seg.

  5. Programming Environment • You can write your program on Linux/Windows platform. • You can install VMware to run the guest OS(Linux, Windows) on it.

  6. Environment Construction • 一台有一張以上網卡的電腦 (PC_E) • 其他電腦用連接至 PC_E • PC_E 需安裝 Linux/Windows作業系統以及 • Linux: libpcap, libnet • Windows: winpcap or raw socket lib(winsock2) • 亦可在 Windows 下使用 VMware 安裝 Linux 代替PC_E • 仍須兩張實體/虛擬Vmware Host網路卡 • 使 Virtual Machine 的兩張虛擬網路卡分別橋接至兩張實體/虛擬Vmware Host網路卡

  7. Edit VM Setting

  8. Add a Host Virtual Adapters

  9. Add a Ethernet Card 建立兩個 subnet

  10. Add a Ethernet Card

  11. Add a Ethernet Card

  12. Add a Ethernet Card 兩張網卡分別對應到eth0, eth1

  13. Bridge Guest NIC to Host NIC 兩張網卡分別bridged 到 VMnet2, VMnet3

  14. VMware - Environment Construction • 2 VMnet • VMnet4, VMnet5 • 4~5 virtual machines • One of them is quipped with 2 virtual NIC • 2NICs are bridged to VMnet4 and VMnet5 respectively

  15. VM configuration • 所有 VM 在同一網段 (192.168.1.x) 下 • 或是 LAN1 / LAN2 各一個網段但所有的 netmask 要設為 255.255.0.0 才能互通 • 虛擬網路卡 bridge 到相對應的 VMnet 192.168.1.1 192.168.1.5 192.168.1.3 192.168.1.4 192.168.1.2

  16. 複製 VM • 複製整個 VMimage 的資料夾 • 若出現 ”this virtual machine appears to be in use” 的錯誤訊息,記得先將 VMware image 檔資料夾內副檔名為 .lck 的資料夾刪除 • “找不到網卡” • sudo su • rm /etc/udev/rules.d/70-persistent-net.rules • reboot

  17. 手動設定 IP • sudo su • vi /etc/network/interfaces • auto eth0 • iface eth0 inet staticaddress 192.168.1.1netmask 255.255.255.0 • /etc/init.d/networking restart

More Related