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