Linux常用命令--网终设置
生活随笔
收集整理的這篇文章主要介紹了
Linux常用命令--网终设置
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
1、把自己(sa)添加到sudoers配置文件中,以便于獲取權限
vim /etc/sudoers 編輯文件(部分centOS版本沒有vim命令,則用vi即可) 找到【root ALL=(ALL) ALL】語句,在下面添加: sa ALL=(ALL) ALL 特別說明:sa添加到sudoers配置文件中后,才可以使用sudo命令。
2、聯網
ifconfig 查看網絡狀態 查看這個服務器最多可放多少網卡,如 eth0,eth1,eth2...
ifup eth0 激活網卡(eth0代表第一張網卡) 這是簡寫 ,如果沒有效果可以改用 下面
ifconfig eth0 down 停下網卡 eth0
ifconfig eth0 up 啟動網卡eth0
? ?
sudo ifup eth0 使用sudo命令,讓自己暫時擁有管理員權限,來激活網卡 ? 查看是否有網卡接通: ethtool ? ?eth0; eth0是網卡的名字,當下面顯示信息中Link detecte為 yes時說明這個網卡接通了,Speed 表示網卡的速度
[root@lingdian03 /]# ethtool eth0 Settings for eth0:Supported ports: [ TP ]Supported link modes: 10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/FullSupported pause frame use: SymmetricSupports auto-negotiation: YesAdvertised link modes: 10baseT/Half 10baseT/Full100baseT/Half 100baseT/Full1000baseT/FullAdvertised pause frame use: SymmetricAdvertised auto-negotiation: YesSpeed: Unknown!Duplex: Unknown! (255)Port: Twisted PairPHYAD: 1Transceiver: internalAuto-negotiation: onMDI-X: UnknownSupports Wake-on: pumbgWake-on: gCurrent message level: 0x00000007 (7)drv probe linkLink detected: no
3、ping
ping www.baidu.com 檢查網絡是否通暢,ping 域名 和 ip都行
Ctrl+C組合鍵 終止大部分命令運行(可以用來退出ping狀態) ?
轉載于:https://www.cnblogs.com/flxy-1028/p/8980432.html
總結
以上是生活随笔為你收集整理的Linux常用命令--网终设置的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Selenium(3)
- 下一篇: 袋鼠过河(动态规划)