美文网首页
kali设置静态ip地址

kali设置静态ip地址

作者: 程序员的一天 | 来源:发表于2020-09-01 16:57 被阅读0次

1、查看网卡:

root@kali:~# ifconfig

如果ifconfig命令不可用,使用apt-get安装:

root@kali:~# apt-get -y install net-tools

或者使用ip addr查看:

root@kali:~# ip addr

2、修改network配置文件

文件位置:

/etc/network/interfaces

原始文件内容(修改前):

root@kali:~# cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

修改后文件内容:

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static  
address 192.168.0.66
netmask 255.255.255.0
gateway 192.168.0.1

主要是在文件末尾增加以下内容:

auto eth0  //指定网卡(根据ifconfig结果修改)
iface eth0 inet static  //启动静态ip
address 192.168.0.66  // 设置静态ip
netmask 255.255.255.0  //子网掩码
gateway 192.168.0.1  //指定网关

3、重启网络:

service networking restart
或者:
systemctl restart networking

# start、status、stop、restart分别表示:启动、查看状态、停止、重启

查看networking状态:

root@kali:~# systemctl status networking
● networking.service - Raise network interfaces
     Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor preset: enabled)
     Active: active (exited) since Mon 2020-07-20 13:06:57 CST; 22s ago

# 看到active (exited)表示正常启动了

4、查看ip

可以看到ip变成了我们设置的ip

root@kali:~# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.0.66  netmask 255.255.255.0  broadcast 192.168.0.1

END.

微信公众号:程序员的一天


程序员的一天

相关文章

  • kali设置静态ip地址

    1、查看网卡: 如果ifconfig命令不可用,使用apt-get安装: 或者使用ip addr查看: 2、修改n...

  • 网络协议(十三)-应用层(DHCP)

    IP地址的分配 IP地址按照分配方式, 可以分为: 静态IP地址, 动态IP地址-- 静态IP地址✅手动设置✅适用...

  • 设置静态IP地址

    第一步:进入 /etc/sysconfig/network-scripts/目录 第二步:修改ifcfg-eth(...

  • 设置静态IP地址

    第一步:进入 /etc/sysconfig/network-scripts/目录 第二步:修改ifcfg-eth(...

  • 树莓派设置静态IP地址

    在网上找到的设置树莓派静态IP地址的方法已经不能用了,无法成功设置,这里说下如何成功设置树莓派静态IP地址。方法一...

  • 配置静态IP

    配置静态IP 1、设置IP地址: # vim /etc/network/interfaces # The prim...

  • 树莓派备忘

    设置静态ip地址 修改cmdline.txt在行首插入ip=192.168.3.111 设置无线网卡的ip 编辑配...

  • 窥探**电脑浏览网页图片 ARP欺骗

    准备 攻击环境:kali (可以上网的kali)自己的ip地址*对方的ip地址*路由的ip地址*同一网段 “*”表...

  • ubuntu设置静态ip地址

    1、修改配置文件 vi /etc/network/interfaces 2、添加 auto eth0 iface ...

  • 【linux】设置静态ip地址

    使用vim打开配置文件 设置为静态ip,将BOOTPROTO="dchp" 改为BOOTPROTO="static...

网友评论

      本文标题:kali设置静态ip地址

      本文链接:https://www.haomeiwen.com/subject/njivsktx.html