raspberry pi 3 自啟動設定USB網卡IP

來源:互聯網
上載者:User

標籤:respberry pi 3 ;樹梅派;外接網卡;ip

1.需求:

項目中需要為respberry pi外接一個USB網卡,在respberry pi啟動的時候需要為這個網卡進行一些網路設定。

2.實現方案:

(1)在/etc/rc.local檔案中加入如下代碼:

if  [ -x /etc/mynet.conf ]; then            /etc/mynet.conf &fi

(2)完成mynet.conf指令碼並放到/etc/目錄下,mynet.conf的內容如下:

#!/bin/bashwhile ! iw dev wlan1 info &>/tmp/netlog; do            sleep 0.2 done  ifconfig wlan1 down iw dev wlan1 interface add ah0 type ibss ifconfig ah0 up iw dev ah0 ibss join RPI-ah0 2462 ifconfig ah0 192.168.2.6  route add 192.168.1.102 gw 192.168.1.102 dev wlan0 route add 192.168.2.102 gw 192.168.2.102 dev ah0

(3)設定mynet.conf檔案可執行許可權,開啟終端輸入以下命令:

sudo chmod 755 /etc/mynet.conf


本文出自 “wauoen” 部落格,請務必保留此出處http://7183397.blog.51cto.com/7173397/1834360

raspberry pi 3 自啟動設定USB網卡IP

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.