最新消息:觉得本站不错的话 记得收藏哦 博客内某些功能仅供测试 讨论群:135931704 快养不起小站了 各位有闲钱就打赏下把 My Email weicots#gmail.com Please replace # with @

systemctl跟 ip 命令用法

LINX ajiang-tuzi 4000浏览

systemctl 命令用于取代 chkconfig service 命令

对比表,以 apache / httpd 为例
任务 旧指令 新指令
使某服务自动启动 chkconfig –level 3 httpd on systemctl enable httpd.service
使某服务不自动启动 chkconfig –level 3 httpd off systemctl disable httpd.service
检查服务状态 service httpd status systemctl status?httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active)
显示所有已启动的服务 chkconfig –list systemctl list-units –type=service
启动某服务 service httpd start systemctl start httpd.service
停止某服务 service httpd stop systemctl stop httpd.service
重启某服务 service httpd restart systemctl restart httpd.service

Linux ip 命令 用于取代 ifconfig命令

//如今官方不再推荐使用如此陈旧的ifconfug命令而推荐使用 ip 这个命令,以下我们看看它的用法:
ip  [选项]  操作对象{link|addr|route...}

# ip link show                  # 显示网络接口信息
# ip link set eth0 upi          # 开启网卡
# ip link set eth0 down         # 关闭网卡
# ip link set eth0 promisc on   # 开启网卡的混合模式
# ip link set eth0 promisc offi # 关闭网卡的混个模式
# ip link set eth0 txqueuelen 1200    # 设置网卡队列长度
# ip link set eth0 mtu 1400     # 设置网卡最大传输单元
# ip addr show                  # 显示网卡IP信息
# ip addr add 192.168.0.1/24 dev eth0 # 设置eth0网卡IP地址192.168.0.1
# ip addr del 192.168.0.1/24 dev eth0 # 删除eth0网卡IP地址

# ip route list                 # 查看路由信息
# ip route add 192.168.4.0/24  via  192.168.0.254 dev eth0 # 设置192.168.4.0网段的网关为192.168.0.254,数据走eth0接口
# ip route add default via  192.168.0.254  dev eth0    # 设置默认网关为192.168.0.254
# ip route del 192.168.4.0/24    # 删除192.168.4.0网段的网关
# ip route del default    # 删除默认路由

转载请注明:(●--●) Hello.My Weicot » systemctl跟 ip 命令用法

蜀ICP备15020253号-1