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 ...
随机推荐
- Xcode6中添加pch文件
转自:http://www.cnblogs.com/YouXianMing/p/3989155.html 1. 新建工程: 2. 创建pch文件: 3. 在setting里面进行设置: 4. 一切尽在 ...
- 深入理解Linux内核-进程调度
1.什么时候进行进程切换 调度策略目标:1.进程响应尽量快:2.后台作业吞吐量尽量高:3.尽可能避免进程饥饿:4.低优先级和高优先级进程需要尽量调和. 调度策略:决定什么时候选择什么进程运行的规则.基 ...
- RVM切换ruby版本号
RVM是Ruby Version Manager的缩写,是一个命令行工具,它能够让你轻松地安装,管理和使用多个版本号的Ruby.不同的rails项目使用等ruby和rails版本号不一样的时候.能够使 ...
- UI设计文本框解决Placeholder的在IE10 以下 IE 9 IE8 IE 7 的兼容问题
创建JS文件 placeholderfriend.js (function($) { /** * 牛叉的解决方案 */ var placeholderfriend = { focus: functio ...
- javascript基础拾遗(四)
1.什么是闭包 正常函数,执行完毕后相关的参数,变量就释放掉了. 当一个函数的返回值是另一个函数时,该函数的相关参数和变量都会保存在返回的函数中,这种结构叫做闭包. 2.示例 计算数组和 functi ...
- 每日英语:Tencent Fights for China's Online Shoppers
In the war for the Chinese Internet, messaging giant Tencent is taking the battle to rival Alibaba's ...
- HA&Federation【转】
转自:http://blog.csdn.net/tutucute0000/article/details/39756123 从nameNode1.namenode2克隆出namenode3.namen ...
- 【ARM】2410裸机系列-中断处理
目的 为了更好地掌握S3C2410中断的原理及中断程序的编写. 内容利用S3C2410的外部中断0和外部中断1实现两个按键功能 原理 本次选择的是外部中断EXTINT0和EXTINT11.中断的产生分 ...
- Spark 保存文件 自定义分隔符
Spark 保存文件 调整分隔符 废话 找了半天没找到,在某个地方看到了类似的(文中说的是读取的时候指定),试了一下保存,发现也好用,详细如下. 用法 df.write.option("de ...
- 开源搜素引擎——Nutch
Nutch简介 Nutch 是一个开源Java实现的搜索引擎.它提供了我们运行自己的搜索引擎所需的全部工具.包括全文搜索和Web爬虫. Nutch 是一个开源Java 实现的搜索引擎.它提供了我们运行 ...