linux雙網卡上內外網設定(樹莓派)

來源:互聯網
上載者:User

linux雙網卡上內外網設定(樹莓派) 樹莓派雙網卡上外網,有以下幾種方式。 1)使用有線網路連接PC,將PC做成網關。 2)另外一種是有線接內網,無線接外網。   www.2cto.com  最關鍵的是,即使設定檔中有多個網卡,但gateway只能有一個,否則外網無法訪問。  有些路由器在dhcp模式下,設定了靜態ip,還需要做IP地址與MAC地址綁定,才可以解決訪問外網問題。   www.2cto.com  筆者使用的無線網卡型號為 EDUP EP-N8508GS黃金版 迷你USB無線網卡 此網卡在windows使用需要安裝驅動,在pi上使用是免驅的 筆者將第二種上網方式與大家分享,如有需要深入瞭解第一種方式上網的,請留言跟帖。 下面是修改後的/etc/networking/interfaces檔案 auto lo  iface lo inet loopback  # ethernet,乙太網路卡,直接接筆記本上,並設定靜態IP auto eth0 #iface eth0 inet dhcp iface eth0 inet static address 192.168.2.100 netmask 255.255.255.0 #gateway 192.168.2.1  # company,公司有密碼,自動擷取IP auto wlan0 allow-hotplug wlan0 iface wlan0 inet dhcp wpa-ssid 網路名稱 wpa-psk 密碼   # home auto wlan0,家中有密碼,手動設定靜態IP allow-hotplug wlan0 iface wlan0 inet static address 192.168.1.199 netmask 255.255.255.0 #gateway 192.168.1.1 wpa-ssid 網路名稱 wpa-psk 密碼 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.