日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

基础网络操作命令

發布時間:2025/3/19 编程问答 40 豆豆
生活随笔 收集整理的這篇文章主要介紹了 基础网络操作命令 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

ifup

作用:啟動網絡接口,直接在/etc/sysconfig/network-scripts下搜索對應的配置文件

用法:ifup interface

例如:

[root@lb ~]# ifup eth0


ifdown

作用:關閉網絡接口,直接在/etc/sysconfig/network-scripts下搜索對應的配置文件

用法:ifdown interface

例如:

[root@lb ~]# ifdown eth0


ifconfig

作用:查看或配置網絡接口信息

用法:ifconfig <interface>

例如:

[root@lb ~]# ifconfig eth0????##查看網絡接口信息
eth0????? Link encap:Ethernet? HWaddr 00:0C:29:D9:E0:37 ?
????????? inet addr:192.168.1.128? Bcast:192.168.1.255? Mask:255.255.255.0
????????? inet6 addr: fe80::20c:29ff:fed9:e037/64 Scope:Link
????????? UP BROADCAST RUNNING MULTICAST? MTU:1500? Metric:1
????????? RX packets:431 errors:0 dropped:0 overruns:0 frame:0
????????? TX packets:327 errors:0 dropped:0 overruns:0 carrier:0
????????? collisions:0 txqueuelen:1000
????????? RX bytes:53230 (51.9 KiB)? TX bytes:53540 (52.2 KiB)

[root@lb ~]# ifconfig eth0 192.168.1.128 netmask 255.255.255.0????##臨時配置網絡接口信息,重啟會失效


ip addr

作用:查看所有網絡接口信息

例如:

[root@lb ~]# ip addr
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
??? link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
??? inet 127.0.0.1/8 scope host lo
??? inet6 ::1/128 scope host
?????? valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
??? link/ether 00:0c:29:d9:e0:37 brd ff:ff:ff:ff:ff:ff
??? inet 192.168.1.128/24 brd 192.168.1.255 scope global eth0
??? inet6 fe80::20c:29ff:fed9:e037/64 scope link
?????? valid_lft forever preferred_lft forever


ping

作用:檢查物理鏈路的連通性

用法:ping serverip

例如:

[root@lb ~]# ping 192.168.1.128????##表示通
PING 192.168.1.128 (192.168.1.128) 56(84) bytes of data.
64 bytes from 192.168.1.128: icmp_seq=1 ttl=64 time=0.038 ms
64 bytes from 192.168.1.128: icmp_seq=2 ttl=64 time=0.035 ms
64 bytes from 192.168.1.128: icmp_seq=3 ttl=64 time=0.035 ms
64 bytes from 192.168.1.128: icmp_seq=4 ttl=64 time=0.034 ms

[root@lb ~]# ping 192.168.1.129????##表示不通
PING 192.168.1.129 (192.168.1.129) 56(84) bytes of data.
From 192.168.1.128 icmp_seq=1 Destination Host Unreachable
From 192.168.1.128 icmp_seq=2 Destination Host Unreachable
From 192.168.1.128 icmp_seq=3 Destination Host Unreachable
From 192.168.1.128 icmp_seq=5 Destination Host Unreachable


telnet

作用:遠程登錄到網絡中的計算機或測試端口是否正常開啟

用法:telnet serverip <port>

例如:

[root@lb ~]# telnet 192.168.1.128 51898????##Connected表示通

Trying 192.168.1.128...
Connected to 192.168.1.128.
Escape character is '^]'.
SSH-2.0-OpenSSH_5.3

[root@lb ~]# telnet 192.168.1.129 51898????##No route to host表示不通

Trying 192.168.1.129...
telnet: connect to address 192.168.1.129: No route to host


ssh

作用:遠程登錄網絡中的計算機

用法:ssh username@serverip -p port

例如:

[root@lb ~]# ssh linbin@192.168.1.128 -p 51898
The authenticity of host '[192.168.1.128]:51898 ([192.168.1.128]:51898)' can't be established.
RSA key fingerprint is 23:69:bd:25:1e:61:00:28:b7:86:b5:1e:71:1f:11:1b.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added '[192.168.1.128]:51898' (RSA) to the list of known hosts.
linbin@192.168.1.128's password:
Last login: Wed Nov 25 09:03:28 2015 from 192.168.1.1
[linbin@lb ~]$

轉載于:https://blog.51cto.com/dongshi/1716285

總結

以上是生活随笔為你收集整理的基础网络操作命令的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。