linux 配置网卡


if config 配置网卡

 

ifconfig :显示所有网卡信息

ifconfig eth0 : 查看网卡eth0的信息

ifconfig eth0 down :禁用eth0

if config eth0 up : 激活eth0

if config eth0 192.168.1.101 : 配置网卡eth0的IP地址

 

网络设置:

sudo route add default gw 192.168.1.1  : 添加网关

/etc/network/interfaces restart  : 重启网络服务

 

 

配置DNS:

 

sudo vi /etc/resolv.conf :

nameserver 202.96.134.133

nameserver 202.96.128.68

nameserver 202.96.128.68

 

配置静态IP:

sudo vi /etc/network/interfaces :

iface eth0 inet static  # 配置eth0接口为静态地址

address 192.168.1.10

gateway 192.168.1.254

netmask 255.255.255.0

network 192.168.1.0

broadcast 192.168.1.255

抓包:

tcpdump -i wlan0

返回上一次的路径 :

cd -

 

 

 

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM