随笔 - 350  文章 - 0  评论 - 6  阅读 - 29万

新安装SuSE后,配置IP相关参数

配置IP,网关,DNS等相关信息

 /etc/sysconfig/network/

suse-linux:~ # cd /etc/sysconfig/network/
suse-linux:/etc/sysconfig/network # ll
total 60
-rw-r--r-- 1 root root 9692 Nov 24 04:30 config
-rw-r--r-- 1 root root 11495 Nov 24 04:30 dhcp
drwxr-xr-x 1 root root 40 Nov 24 04:30 if-down.d
drwxr-xr-x 1 root root 66 Nov 24 04:30 if-up.d
-rw-r--r-- 1 root root 206 Nov 30 21:45 ifcfg-eth0   (配置IP,子网掩码)
-rw------- 1 root root 147 Nov 24 04:30 ifcfg-lo
-rw-r--r-- 1 root root 21738 Oct 14 2016 ifcfg.template
drwx------ 1 root root 0 Jun 27 2017 providers
drwxr-xr-x 1 root root 206 Nov 24 04:30 scripts

 

配置网关

suse-linux:/etc/sysconfig/network # vim ifroute-eth0 # 这个文件需要自己创建
default 192.168.10.2 - eth0

 

配置DNS

suse-linux:/etc/sysconfig/network # cat /etc/resolv.conf
# Note: Manual change of this file disables netconfig too, but
# may get lost when this file contains comments or empty lines
# only, the netconfig settings are same with settings in this
# file and in case of a "netconfig update -f" call.
#
### Please remove (at least) this line when you modify the file!
nameserver 192.168.10.2

 

suse-linux:~ # systemctl restart network
suse-linux:~ # ping www.baidu.com -w 1

SSH

suse-linux:~ # vim /etc/ssh/sshd_config # 下面两项打开注释,改为yes即可
PermitRootLogin yes # 允许root用户登录
PasswordAuthentication yes # 开启密码验证
suse-linux:~ # systemctl restart sshd

 

关闭防火墙(注意命令中的大小写敏感)

'suse里面的防火墙名称是SuSEfirewall2,和centos不一样'
suse-linux:~ # systemctl disbale SuSEfirewall2 --now
suse-linux:~ # systemctl status SuSEfirewall2
● SuSEfirewall2.service - SuSEfirewall2 phase 2
Loaded: loaded (/usr/lib/systemd/system/SuSEfirewall2.service; disabled; vendor preset: disabled)
Active: inactive (dead)

 

 

SUSE15后关闭防火墙命令有变化

执行:

/usr/sbin/rcfirewalld status

/usr/sbin/rcfirewalld stop

有时候如果不起作用,就先/usr/sbin/rcfirewalld start,再stop

posted on   遇见阿杜  阅读(281)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· Manus重磅发布:全球首款通用AI代理技术深度解析与实战指南
· 被坑几百块钱后,我竟然真的恢复了删除的微信聊天记录!
· 没有Manus邀请码?试试免邀请码的MGX或者开源的OpenManus吧
· 【自荐】一款简洁、开源的在线白板工具 Drawnix
· 园子的第一款AI主题卫衣上架——"HELLO! HOW CAN I ASSIST YOU TODAY
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示