问小白 wenxiaobai
资讯
历史
科技
环境与自然
成长
游戏
财经
文学与艺术
美食
健康
家居
文化
情感
汽车
三农
军事
旅行
运动
教育
生活
星座命理

银河麒麟操作系统网络配置与管理操作教程

创作时间:
作者:
@小白创作中心

银河麒麟操作系统网络配置与管理操作教程

引用
CSDN
1.
https://m.blog.csdn.net/qq274575499/article/details/145320224

银河麒麟操作系统作为国内自主研发的Linux发行版,在各大央企、国企及各级党政机关中广泛应用。本文将详细介绍银河麒麟桌面操作系统V10的网络配置与管理方法,帮助用户快速掌握基本使用技巧。

1. 网络接口配置

(1)在桌面上点击右键,选择“在终端中打开”(或使用快捷键“Ctrl+Alt+T”)来打开终端,使用 ifconfig 命令查看网络接口:

ifconfig -a

获取本地有线网卡设备的网络接口名称:enaftgm1i0,要记住这个名称,后续设置IP地址时需要用到。

(2)编辑网络接口配置文件:

vim /etc/network/interfaces

配置动态IP地址时:

auto enaftgm1i0
iface enaftgm1i0 inet dhcp

配置静态IP地址时,需要添加以下内容:

iface enaftgm1i0 inet static
address 192.168.0.94
netmask 255.255.255.0
gateway 192.168.0.1
dns-nameservers 192.168.0.1

2. 网络服务管理

(1)启动网络服务:

sudo systemctl start networking

(2)停止网络服务:

sudo systemctl stop networking

(3)重启网络服务:

编辑网络接口配置文件后需要重启网络服务。

sudo systemctl restart networking

(4)检查网络服务状态:

sudo systemctl status networking

3. 防火墙配置

银河麒麟默认使用 iptables 或 firewalld 进行防火墙管理。

(1)使用 iptables:

添加规则,如不允许用户访问本机的22端口。

sudo iptables -I INPUT -p tcp --dport 22 -j DROP

添加规则,如防止ICMP类型的主机发现,可以防PING。

sudo iptables -I INPUT -p icmp -j REJECT

(2)启动/重启 firewalld:

sudo systemctl start firewalld
sudo systemctl restart firewalld

(3)保存防火墙规则

更改防火墙规则后,需要保存这些规则以便在系统重启后仍然有效。

sudo iptables-save > /etc/iptables.rules

(4)查看防火墙规则:

sudo iptables -L -n

4. 网络监控与故障排除

(1)监控网络流量:

使用 iftop 工具:

sudo apt install iftop
iftop

使用 nload 工具:

sudo apt install nload
nload

(2)故障排除工具:

  • ping:测试网络连通性。
  • traceroute:跟踪数据包路径。
  • netstat:显示网络连接、路由表等信息。
  • tcpdump:抓取和分析网络数据包。

5. 安全性增强

(1)停止不必要的服务:

sudo systemctl stop <service_name>

(2)更新系统和软件包:

sudo apt update
sudo apt upgrade

(3)配置SSH安全:

编辑 /etc/ssh/sshd_config 文件,关闭密码登录,开启密钥认证,提高SSH使用的安全性。

PubkeyAuthentication yes
PasswordAuthentication no

重启SSH服务:

sudo systemctl restart ssh
© 2023 北京元石科技有限公司 ◎ 京公网安备 11010802042949号