Raspberry Pi connected to the campus network set up static IP (wired)

System: kail2.0 (based on debian) (Do not ask why this is also engaged with server orz)

Campus network in the form of: bedroom root port, the connection that is

  1. In fact, debian and settings are the same, static ip need to be set within the range of the original distribution, so you can directly set the current position with this function
  2. cp / etc / network / interfaces / etc / network / interfacesbak # backup the original configuration file
  3. The machine (see ifconfig input Raspberry Pi IP, gateway, subnet mask), and does not show the direction of raspberry send default gateway, which will then switch to normal win system, enter ipconfig obtain default gateway (wired to the beginning eth , wlan wireless, inet is ip, netmask is the subnet mask)
  4. nano / etc / network / interfaces # NIC configuration file editing
  5. Before iface ens32 inet static with the #, add (to change following their own set of needs)

    face ens32 inet static #static represent a fixed ip, dhcp expression using dynamic ip
    address 192.168.21.166 # set ip address [the same address as ipconfig, ping before the last port change the port to determine what nobody uses]
    netmask 255.255.255.0 # set the subnet mask
    gateway 192.168.21.2 # set gateway

  6. /etc/init.d/networking restart # restart card
  7. Some tutorials also modified the DNS, but in fact no need to modify also OK
  8. service networking restart # restart the network
  9. reboot

Reference:
https://blog.csdn.net/guigui_oy/article/details/80913526
https://www.cnblogs.com/hongdada/p/9876508.html

Guess you like

Origin www.cnblogs.com/just-save/p/11871527.html