日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 >

IP ,路由

發布時間:2025/3/15 21 豆豆
生活随笔 收集整理的這篇文章主要介紹了 IP ,路由 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
ifconfig 命令 ip信息 enp0s3: flags=4163<UP(已經啟用),BROADCAST(支持廣播),RUNNING,MULTICAST(支持多播)> mtu 1500 inet 192.168.23.11 netmask 255.255.255.0 broadcast 192.168.23.255 inet6 fe80::a00:27ff:fec1:cd2b prefixlen 64 scopeid 0x20<link> ether 08:00:27:c1:cd:2b txqueuelen 1000(傳輸隊列長度) (Ethernet) RX(接受的數據包) packets 28355 bytes 10835366 (10.3 MiB) RX errors(錯誤包數量) 0 dropped(丟包數量) 0 overruns 0 frame 0 TX(傳出的數據包) packets 15286 bytes 2489410 (2.3 MiB) TX errors(錯誤包數量) 0 dropped(丟包數量) 0 overruns 0 carrier 0 collisions 0

?

ifconfig命令使用(設置IP地址可以立即生效)
1)顯示激活網卡,以及網絡信息 ifconfig (2)顯示激活網卡,以及網絡信息 ifconfig eth0 (3)顯示所有網卡,以及網絡信息 ifconfig -a (4)啟用網卡地址 ifconfig eth0 up ifconfig enp0s3 up 5)停止網卡地址 ifconfig eth0 down ifconfig enp0s3 down 6)網卡取別名的兩種寫法 ifconfig eth0:0 192.168.23.10/24 ifconfig enp0s3:0 192.168.23.100 netmask 255.255.255.0 broadcast 192.168.23.255
  • (2)route命令
1:增 添加主機地址路由 route add -host 192.168.24.100 gw 192.168.23.1 dev eth0 添加網絡地址路由 route add -net 192.168.24.0/24 gw 192.168.23.1 dev eth0 添加默認地址路由 route add -net 0.0.0.0/0.0.0.0 gw 192.168.23.1 dev eth0 2:刪 刪除主機地址路由 route del -host 192.168.24.100 刪除網絡地址路由 route del -net 192.168.24.0/24 刪除默認地址路由 route del default 3:改 先刪除,再修改 4:查 route -n Kernel IP routing table Destination(目的地址) Gateway(網關,嚇一跳) Genmask(子網掩碼) Flags Metric Ref Use Iface(接口) 192.168.23.0 0.0.0.0(同一個網段無需網關) 255.255.255.0 U 0 0 0 eth0 192.168.23.0 0.0.0.0 255.255.255.0 U(up:表示啟用狀態) 0 0 0 eth1 169.254.0.0 0.0.0.0 255.255.0.0 U 1002 0 0 eth0 0.0.0.0 192.168.23.1 0.0.0.0 UG(G表示網關) 0 0 0 eth0
  • (3)netstat命令(對應的ss命令請自行總結)
會經常使用 必備技能:netstat -lntup -u:UDP -t:TCP -l:查看監聽狀態 -n:以數字的形式顯示 -p:顯示進程、服務名稱 -a:顯示all信息 [root@6 ~]# netstat -lentupa Active Internet connections (servers and established) Proto(協議) Recv-Q(接收) Send-Q(發送) Local Address(本地監聽的套接字) Foreign Address(客戶端連接的套接字) State(進程狀態) User(用戶的id) Inode(文件的inode號) PID/Program name tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 9197 1090/sshd tcp 0 0 192.168.23.4:22 192.168.23.2:65106 ESTABLISHED 0 9567 1191/sshd tcp 0 0 :::22 :::* LISTEN 0 9199 1090/sshd udp 0 0 0.0.0.0:68 0.0.0.0:* 0 8497 856/dhclient
  • (4)ifup、ifdown命令
需要添加/etc/sysconfig/network-scripts/ifcfg-eth1網卡配置文件,才能給ifup、ifdown控制 ifup eth1 ifdown eth1

?

轉載于:https://www.cnblogs.com/liu1026/p/7498031.html

總結

以上是生活随笔為你收集整理的IP ,路由的全部內容,希望文章能夠幫你解決所遇到的問題。

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