《Linux菜鸟入门》Linux网络管理
●管理網(wǎng)絡
?
??1.ip基礎知識
??? ipv4/ipv6
???32位
???172.25.0.10/255.255.255.0
?? 2.配置ip
??? <<圖形化>>
???? 1。圖形界面
????nm-connection-editor
???? 2.文本化圖形
????nmtui
?
??? ifconfig ?????????????????? 查看或者臨時設定主機ip的工具
??? ifconfig 網(wǎng)絡接口?????????????? 查看這個接口上的 ip
??? ifconfig 網(wǎng)絡接口 ip netmask 子網(wǎng)掩碼???? 臨時設定ip
??? ifconfig eth0 172.25.254.100 netmask 255.255.255.0
?
??? systemctl restart network ????重新啟動網(wǎng)絡基本服務
??? systemctl restart NetworkManager? 網(wǎng)絡智能管理服務
??<<命令>>
? ?? ifconfig 網(wǎng)卡 ip netmask ??臨時設定
? ?? nmcli :
????system ststus NetWork
?connection add type ethernet ?con-name westos ifname eth0 autoconnect yes
?nmcli connection add type ethernet con-name westos ifname ip4 ip/24
?nmcli connection add delete westos
?nmcli connection show
?nmcli connection down westos
?nmcli connection up westos
?nmcli connection modify westos ipv4.addresses newip/24
?nmcli connection modify westos ipv4.method <auto|manual>
?nmcli device connect
?nmcli device disconnect
?nmcli device show
?nmcli device status
?
? <<文件>>
????dhcp ????動態(tài)獲取
????vim ???/etc/sysconfig/network-scripts/ifcfg-eth0
??? DEVICE=eth0
??? BOOTPROTO=dhcp
??? ONBOOT=yes
??? NAME=eth0
??? :wq
??? systemctl restart network
?
??? static|none ??靜態(tài)網(wǎng)絡
? ? ? vim ???/etc/sysconfig/network-scripts/ifcfg-eth0
? ?? DEVICE=eth0
? ?? BOOTPROTO=static|none
? ?? ONBOOT=yes
? ?? IPADDR(x)=172.25.0.100
? ?? NETNASK=172.25.0.100 | PREFIS0=24 ??子網(wǎng)掩碼
? ?? NAME=eth0
??? :wq
???? systemctl restart network
????如果要設置多個ip 就在x位置
轉載于:https://blog.51cto.com/12157236/1861116
總結
以上是生活随笔為你收集整理的《Linux菜鸟入门》Linux网络管理的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 记录一次postfix无法收取邮件和my
- 下一篇: Linux c中使用系统时间