zoukankan      html  css  js  c++  java
  • kali linux 静态地址和动态地址的设置

    在文件系统里找到/etc/network下的interfaces文件,打开后可以看到eth0为dhcp,将其修改为

    # This file describes the network interfaces available on your system

    # and how to activate them. For more information, see interfaces(5)。

    # The loopback network interface

    auto lo

    iface lo inet loopback

    auto eth0

    iface eth0 inet static //配置eth0使用默认的静态地址

    address 192.168.77.133 //设置eth0的IP地址

    netmask 255.255.255.0 //配置eth0的子网掩码

    gateway 192.168.77.254 //配置当前主机的默认网关

    “interfaces”文件中还有很多其他的设置项,如需要了解更多的信息,可以使用man命令查询“interfaces”文件的手册页。

    ******后期想将静态地址改成dhcp,只需要改成如下格式即可*****

    auto lo

    iface lo inet loopback

    auto eth0

    iface eth0 inet dhcp //配置eth0使用动态地址

    #man interfaces

    其中eth0指本机以太网卡一,类似的,eth1指本机的以太网卡2。一般一台电脑只有一个eth0。网卡的设备名/dev/eth0 和硬件的MAC 地址52:54:AB:DD:6F:61对应,MAC 地址是生产厂家定的,每个网卡拥有的唯一地址。

    linux下,用ifconfig后,能看到eth0,可能还会看到eth0:1。其中eth0:1是指eth0的分ip存储文件,分ip存储文件格式为ifcfg-eth0:X, X为任意正整数(包括0)

    具体作用是实现单网卡多ip,类似与windows的多ip。

  • 相关阅读:
    RE
    【LeetCode】198. House Robber
    【LeetCode】053. Maximum Subarray
    【LeetCode】152. Maximum Product Subarray
    【LeetCode】238.Product of Array Except Self
    【LeetCode】042 Trapping Rain Water
    【LeetCode】011 Container With Most Water
    【LeetCode】004. Median of Two Sorted Arrays
    【LeetCode】454 4Sum II
    【LeetCode】259 3Sum Smaller
  • 原文地址:https://www.cnblogs.com/lzkalislw/p/15172102.html
Copyright © 2011-2022 走看看