Kali配置网卡静态信息
临时配置ip
ifconfig eth0 up //端口启用
ifconfig eth0 down //端口关闭
ifconfig eth0 192.168.1.10 //只修改ip地址
ifconfig eth0 192.168.1.10/ 或者 ifconfig eth0 1.1.1.1 netmask 255.0.0.0
临时修改路由
route //查看路由表
netstat -rn //查看路由表
route del default eth0 //删除eth0上的默认路由
route add default gw 192.168.1.1 //添加默认路由
修改配置文件修改网卡信息
/etc/network/interfaces auto lo
iface lo inet loopback
allow-hotplug eth0
iface eth0 inet dhcp iface eth0 inet6 auto 修改为: auto lo
iface lo inet loopback
allow-hotplug eth0
auto eth0 # 增加了该选项,因为使用networking restart时系统启动 auto的网卡,如不加上则启动无反应
iface eth0 inet static # 配置了static 为静态ip | 自动获取 iface eth0 inet dhcp
address 192.168.1.4 # 设置ip地址
netmask 255.255.255.0 # 设置掩码
gateway 192.168.1.1 # 设置网关
dns-nameservers 223.5.5.5 # 错误的
iface eth0 inet6 auto # 可写可不写
终端命令行下重启网络:service networking restart或 /etc/init.d/networking restart 。
报错信息
root@bogon:~# /etc/init.d/networking restart
[....] Restarting networking (via systemctl): networking.serviceJob for networking.service failed because the control process exited with error code.
See "systemctl status networking.service" and "journalctl -xe" for details.
failed!
root@bogon:~# vim /etc/network/interfaces
root@bogon:~# systemctl status networking.service
● networking.service - Raise network interfaces
Loaded: loaded (/lib/systemd/system/networking.service; enabled; vendor prese
Active: failed (Result: exit-code) since Sun -- :: CST; 58s ago
Docs: man:interfaces()
Process: ExecStartPre=/bin/sh -c if [ "$CONFIGURE_INTERFACES" != "no" ] &
Process: ExecStart=/sbin/ifup -a --read-environment (code=exited, status=
Main PID: (code=exited, status=/FAILURE) 4月 :: bogon systemd[]: Starting Raise network interfaces...
4月 :: bogon ifup[]: Not enough information: "dev" argument is requ
4月 :: bogon ifup[]: ifup: failed to bring up eth0
4月 :: bogon systemd[]: networking.service: Main process exited, code=
4月 :: bogon systemd[]: networking.service: Failed with result 'exit-c
4月 :: bogon systemd[]: Failed to start Raise network interfaces.
lines -/ (END)
注意代码后面不能有注释,否则报错,需要把注释删除掉
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(). source /etc/network/interfaces.d/* # The loopback network interface auto lo
iface lo inet loopback auto eth0
iface eth0 inet static address 192.168.2.135
netmask 255.255.255.0
gateway 192.168.2.1
修改dns配置文件
缺点: 重启后会消失
/etc/resolv.conf
nameserver 202.106.0.20
nameserver 202.106.46.151 修改为:
nameserver 202.106.0.20
nameserver 202.106.46.151
nameserver 8.8.8.8
Kali配置网卡静态信息的更多相关文章
- 虚拟机桥接网卡下配置centOS静态IP
前面我们讲了怎么去配置asterisk,但是配置完了,是没有什么效果出现的,因为asterisk相当于一个服务器,我们需要一个客户端去给它连接起来,如果你是在自己的机子上装了虚拟机,那最好配一下cen ...
- linux配置网卡IP地址命令详细介绍及一些常用网络配置命令
linux配置网卡IP地址命令详细介绍及一些常用网络配置命令2010-- 个评论 收藏 我要投稿 Linux命令行下配置IP地址不像图形界面下那么方 便,完全需要我们手动配置,下面就给大家介绍几种配置 ...
- 改动网卡IP信息
改动网卡IP信息的情况有非常多种,只是从大体上能够分为两种,一种是暂时改动,重新启动网络服务后改动便会失效:一种是永久改动,重新启动网络服务后才会生效.一般暂时改动应用在暂时的动作中,我们通过分类名字 ...
- 手动配置网卡配置文件ifcfg-eth0
linux 其他知识目录 原文链接:https://www.cnblogs.com/arvintang/p/5990599.html 网络接口配置文件[root@localhost ~]# cat / ...
- (转)linux配置网卡的命令
linux配置网卡的命令 原文:http://blog.51cto.com/lanxianting/1754923 1.配置命令 如果一台服务器需要通外网,能被远程连接,就得给这个台服务器配置ip,子 ...
- CentOS配置网卡以及克隆
上一篇的虚拟机安装完成后是可以上网的,但是ip地址是动态的,因为后期的需要,我们要配置下网卡,改成静态的IP地址 1.打开终端,输入 ifconfig 查看虚拟机中的网卡,发现时ens33而不是平常见 ...
- Ubuntu18.04 配置网卡、替换软件源
2019/10/29, Ubuntu Server 18.04 摘要:Ubuntu Server 18.04 采用netplan作为网络配置管理,修改IP使其连上网络,修改替换软件源 修改网卡配置 首 ...
- 日常工作问题解决:centos7下配置网卡以及查询网卡UUID
目录 1.配置网卡 1.1 网卡查看命令:ifconfig -a 1.2 网卡配置文件说明 1.3 重启网络服务 2.查看确认网卡UUID 2.1 网卡配置文件正常时 2.2 网卡配置文件不可用或者配 ...
- Linux下设置网卡静态ip
Linux下设置网卡静态ip 如果是服务器版,没有图形界面只用用命令行修改配置文件 如果是客户端版本,可以用图形界面 配置的前提是要在root用户下才能重启网卡服务 图形界面: system-conf ...
随机推荐
- AlloyTouch全屏滚动插件搞定顺滑H5页
使用姿势 在设计全屏滚动插件的时候,希望开发者几乎: 不用写任何脚本快速生成精致H5 支持PC滚轮和移动触摸 酷炫的转场动效 灵活的时间轴管理 一切皆可配置 但是不写脚本肯定没有灵活性咯?!不是的.这 ...
- [Windows Azure] How to Create and Deploy a Cloud Service?
The Windows Azure Management Portal provides two ways for you to create and deploy a cloud service: ...
- C++11 override和final
30多年来,C++一直没有继承控制关键字.最起码这是不容易的,禁止一个类的进一步衍生是可能的但也很棘手.为避免用户在派生类中重载一个虚函数,你不得不向后考虑. C++ 11添加了两个继承控制关键字:o ...
- Android 编程下 Managing Your App's Memory
Managing Your App's Memory Random-access memory (RAM) 在任何软件开发环境中都是宝贵的资源,它在物理内存有限的移动操作系统中更为宝贵.虽然 Andr ...
- (转)CTP: 平昨仓与平今仓,log轻轻告诉你.......
转自:http://blog.csdn.net/wowotuo/article/details/43242663 CTP的相关文档告诉我们,中金所和三大商品交易所中,只有上期所区分平今仓和平昨仓.也就 ...
- spark编译报错信息简介
spark编译需要环境 git java1.+ maven R 报错信息1: [INFO] ------------------------------------------------------ ...
- 【转】Mysql千万级数据表结构修改
当需要对表进行ddl操作如加索引.增删列时,数据量小时直接在线修改表结构影响不大当表达到百万.千万数据就不能直接在线修改表结构 下面是具体的过程:1.备份数据select * from ih_orde ...
- iOS开发中的火星坐标系及各种坐标系转换算法
原文地址:http://m.oschina.net/blog/619183?ref=myread 其原理是这样的:保密局开发了一个系统,能将实际的坐标转换成虚拟的坐标.所有在中国销售的数字地图必须使用 ...
- 基于jQuery个性圆圈倒计时特效
基于jQuery个性圆圈倒计时特效里面包含十几款不用效果的jQuery倒计时特效下载.效果图如下: 在线预览 源码下载 实现的代码. html代码: <section class=" ...
- 封装篇——图片模块(Glide)
如今市面上差点儿全部的app都用到了图片,图片模块的开发是app开发中不可缺少的一块工作, 开源的力量是强大的.好多优秀的第三方项目能够任君使用,帮助我们提高效率.而且不须要反复造轮子,这边我採用的是 ...