linux网络管理菜鸟,《Linux菜鸟入门》Linux网络管理

●管理网络

1.ip基础知识

ipv4/ipv6

32位

172.25.0.10/255.255.255.0

2.配置ip

<>

1。图形界面

nm-connection-editor

2.文本化图形

nmtui

ifconfig查看或者临时设定主机ip的工具

ifconfig 网络接口查看这个接口上的 ip

ifconfig 网络接口 ip netmask 子网掩码临时设定ip

ifconfig eth0 172.25.254.100 netmask 255.255.255.0

systemctl restart network重新启动网络基本服务

systemctl restart NetworkManager网络智能管理服务

<>

ifconfig 网卡 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

nmcli device connect

nmcli device disconnect

nmcli device show

nmcli device status

<>

dhcp     动态获取

vim    /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth0

BOOTPROTO=dhcp

ONBOOT=yes

NAME=eth0

:wq

systemctl restart network

static|none   静态网络

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   子网掩码

NAME=eth0

:wq

systemctl restart network

如果要设置多个ip 就在x位置

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值