zoukankan      html  css  js  c++  java
  • 树莓派静态IP配置

    一、设置隐藏无线静态ip地址

    1.用命令产生wpa_pskwpa_passphrase “MT-WiFi” “@boozhong.com”

    2.sudo nano /etc/network/interfaces 

     

    auto lo

    iface lo inet loopback

    iface eth0 inet dhcp

     

    auto wlan0

    allow-hotplug wlan0

    iface wlan0 inet static

            address 192.168.0.30

            netmask 255.255.255.0

            gateway 192.168.0.2

            wpa-scan-ssid 1

            wpa-ap-scan 1

            wpa-key-mgmt WPA-PSK

            wpa-proto RSN WPA

            wpa-pairwise CCMP TKIP

            wpa-group CCMP TKIP

            wpa-ssid "MT-WiFi"

            wpa-psk 34f7016d83555ece6041b0ea2afb7939e95c74138c821003d710366d9d2fea90

     

    3.sudo nano /etc/wpa_supplicant/wpa_supplicant.conf

    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

    update_config=1

     

    4.sudo nano /etc/resolv.conf

    nameserver 61.177.7.1

    nameserver 221.228.255.1

     

    二、有线静态IP配置

    1.备份原interfaces文件为interfaces_wifi.back

    2.修改 /etc/network/interfaces
       sudo vim /etc/network/interfaces

    修改为:

      auto lo   

      iface lo inet loopback  

      iface eth0 inet static  

      address 192.168.1.222  

      netmask 255.255.255.0  

      gateway 192.168.1.1  

      allow-hotplug wlan0  

      iface wlan0 inet manual  

      wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf  

     

    3.sudo service networking restart //sudo reboot

     

      sudo ifconfig eth0 192.168.1.222 netmask 255.255.255.0

      sudo route add default gw 192.168.1.1
      sudo ifconfig eth0 up

  • 相关阅读:
    模拟测试20190806
    替罪羊树学习日记
    [Usaco2015 Jan]Moovie Mooving
    [NOIP2016]愤怒的小鸟
    [BZOJ1556]墓地秘密
    [SDOI2009]学校食堂Dining
    [SCOI2008]奖励关
    [洛谷3930]SAC E#1
    [BZOJ2809/APIO2012]dispatching
    [Usaco2018 Open]Disruption
  • 原文地址:https://www.cnblogs.com/cj2014/p/3904548.html
Copyright © 2011-2022 走看看