ファイアウォール初期設定

[root@falcon21 ~]# systemctl status firewalld
firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-11-17 15:47:21 JST; 1h 1min ago
Docs: man:firewalld(1)
Main PID: 939 (firewalld)
Tasks: 2 (limit: 48971)
Memory: 32.6M
CGroup: /system.slice/firewalld.service
└─939 /usr/libexec/platform-python -s /usr/sbin/firewalld --nofork --nopid

11月 17 15:47:19 falcon21.space systemd[1]: Starting firewalld - dynamic firewall daemon...
11月 17 15:47:21 falcon21.space systemd[1]: Started firewalld - dynamic firewall daemon.
11月 17 15:47:22 falcon21.space firewalld[939]: WARNING: AllowZoneDrifting is enabled. This is considered an in>
lines 1-13/13 (END)


ファイアウォールサービス停止
[root@falcon21 ~]# systemctl stop firewalld

ファイアウォール自動起動設定を無効にする
[root@falcon21 ~]# systemctl disable firewalld
Removed /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.


SELinux無効化
[root@falcon21 ~]# vi /etc/selinux/config
7 SELINUX=disabled


再起動して変更を有効にする
[root@falcon21 ~]# reboot

-----------------------------

  
インターネット接続設定.デバイス確認
[root@falcon21 ~]# ifconfig
enp0s25: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.10.3 netmask 255.255.255.0 broadcast 192.168.10.255
inet6 2405:6585:c600:1100:3341:ba8d:5a76:a143 prefixlen 64 scopeid 0x0<global>
inet6 fe80::d192:c235:4cb6:a6ce prefixlen 64 scopeid 0x20<link>
ether 78:2b:cb:95:c1:4f txqueuelen 1000 (Ethernet)
RX packets 416662 bytes 628973180 (599.8 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 103854 bytes 9483706 (9.0 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 21 memory 0xf7ae0000-f7b00000

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
inet 192.168.122.1 netmask 255.255.255.0 broadcast 192.168.122.255
ether 52:54:00:4d:4d:64 txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

 

  Couldn't resolve hostエラー対処

[root@falcon21 ~]# vi /etc/resolv.conf
# Generated by NetworkManager
search space
nameserver 8.8.8.8
 


ルーティング設定
「192.168.0.0/24 192.168.1.0/24 」ネットワーク宛通信のゲートウェイを「192.168.10.3」に設定
[root@falcon21 ~]# route add -net 192.168.1.0 netmask 255.255.255.0 gw 192.168.10.3 enp0s25

「192.168.0.0/24 192.168.2.0/24 」ネットワーク宛通信のゲートウェイを「192.168.10.3」に設定
[root@falcon21 ~]# route add -net 192.168.2.0 netmask 255.255.255.0 gw 192.168.10.3 enp0s25


ルーティングの確認
[root@falcon21 ~]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.10.1 0.0.0.0 UG 0 0 0 enp0s25
192.168.1.0 192.168.10.3 255.255.255.0 UG 0 0 0 enp0s25
192.168.2.0 192.168.10.3 255.255.255.0 UG 0 0 0 enp0s25
192.168.10.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s25
192.168.122.0 0.0.0.0 255.255.255.0 U 0 0 0 virbr0


恒久的にルーティングを追加する方法

ルーティング情報を記述
[root@falcon21 ~]# vi /etc/sysconfig/network-scripts/route-enp0s25
192.168.0.0/24 via 192.168.10.3
192.168.1.0/24 via 192.168.10.3
~

設定反映
[root@falcon21 ~]# service network restart
Redirecting to /bin/systemctl restart network.service
Failed to restart network.service: Unit network.service not found.

---network.service not found.---
[root@falcon21 ~]# systemctl start NetworkManager.service
[root@falcon21 ~]# systemctl enable NetworkManager.service
[root@falcon21 ~]# systemctl status NetworkManager.service
NetworkManager.service - Network Manager
Loaded: loaded (/usr/lib/systemd/system/NetworkManager.service; enabled; vendor preset: enabled)
Active: active (running) since Tue 2020-11-17 11:09:08 JST; 1h 34min ago
Docs: man:NetworkManager(8)
Main PID: 1082 (NetworkManager)
Tasks: 3 (limit: 48960)
Memory: 8.7M
CGroup: /system.slice/NetworkManager.service
└─1082 /usr/sbin/NetworkManager --no-daemon

11月 17 11:09:17 falcon21.space NetworkManager[1082]: <info> [1605578957.2880] device (virbr0): Activation: successf>
11月 17 11:09:17 falcon21.space NetworkManager[1082]: <info> [1605578957.2885] device (virbr0-nic): state change: se>
11月 17 11:09:17 falcon21.space NetworkManager[1082]: <info> [1605578957.2895] device (virbr0-nic): Activation: succ>
11月 17 11:09:17 falcon21.space NetworkManager[1082]: <info> [1605578957.4205] device (virbr0-nic): state change: ac>
11月 17 11:09:17 falcon21.space NetworkManager[1082]: <info> [1605578957.4213] device (virbr0): bridge port virbr0-n>
11月 17 11:09:17 falcon21.space NetworkManager[1082]: <info> [1605578957.4213] device (virbr0-nic): released from ma>
11月 17 11:12:04 falcon21.space NetworkManager[1082]: <info> [1605579124.5117] agent-manager: agent[f41b1eac9bdb33fb>
11月 17 11:54:49 falcon21.space NetworkManager[1082]: <info> [1605581689.8739] manager: kernel firmware directory '/>
11月 17 11:55:41 falcon21.space NetworkManager[1082]: <info> [1605581741.5670] manager: kernel firmware directory '/>
11月 17 11:57:50 falcon21.space NetworkManager[1082]: <info> [1605581870.8159] agent-manager: agent[07c63ff3bb448cd3>
lines 1-20/20 (END)

--------------------------------------

dnfパッケージ管理コマンドの初期設定

DNF 自動アップデート設定
dnf-automaticをインストール

[root@falcon21 ~]# dnf install dnf-automatic
メタデータの期限切れの最終確認: 2:05:14 時間前の 2020年11月17日 11時18分51秒 に実施しました。
依存関係が解決しました。
======================================================================================================================
パッケージ アーキテクチャー バージョン リポジトリー サイズ
======================================================================================================================
インストール中:
dnf-automatic noarch 4.2.17-7.el8_2 BaseOS 141 k

トランザクションの概要
======================================================================================================================
インストール 1 パッケージ

ダウンロードサイズの合計: 141 k
インストール済みのサイズ: 46 k
これでよろしいですか? [y/N]: y
パッケージのダウンロード:
dnf-automatic-4.2.17-7.el8_2.noarch.rpm 1.6 MB/s | 141 kB 00:00
----------------------------------------------------------------------------------------------------------------------
合計 233 kB/s | 141 kB 00:00
トランザクションの確認を実行中
トランザクションの確認に成功しました。
トランザクションのテストを実行中
トランザクションのテストに成功しました。
トランザクションを実行中
準備 : 1/1
インストール中 : dnf-automatic-4.2.17-7.el8_2.noarch 1/1
scriptlet の実行中: dnf-automatic-4.2.17-7.el8_2.noarch 1/1
検証 : dnf-automatic-4.2.17-7.el8_2.noarch 1/1
Installed products updated.

インストール済み:
dnf-automatic-4.2.17-7.el8_2.noarch

完了しました!


DNF 自動アップデートと除外設定
カーネルのバージョンが上がってしまうと、最悪起動しない自体も起こり得るので、予め除外設定
dnf-automaticの設定変更
[root@falcon21 ~]# vi /etc/dnf/automatic.conf
1 [commands]
2 # What kind of upgrade to perform:
3 # default = all available upgrades
4 # security = only the security upgrades
5 upgrade_type = default
6 random_sleep = 0
7
8 # To just receive updates use dnf-automatic-notifyonly.timer
9
10 # Whether updates should be downloaded when they are available, by
11 # dnf-automatic.timer. notifyonly.timer, download.timer and
12 # install.timer override this setting.
13 download_updates = yes
14
15 # Whether updates should be applied when they are available, by
16 # dnf-automatic.timer. notifyonly.timer, download.timer and
17 # install.timer override this setting.
18 apply_updates = yes                 <-- no から yes へ変更            
19 exclude=kernel*                   <-- 追加              
20 exclude=kernel* centos* xorg*          <-- 追加 
21
22 [emitters]


dnf-automaticの開始
[root@falcon21 ~]# systemctl start dnf-automatic.timer
[root@falcon21 ~]# systemctl enable dnf-automatic.timer
Created symlink /etc/systemd/system/multi-user.target.wants/dnf-automatic.timer → /usr/lib/systemd/system/dnf-automatic.timer.
[root@falcon21 ~]# systemctl status dnf-automatic.timer
dnf-automatic.timer - dnf-automatic timer
Loaded: loaded (/usr/lib/systemd/system/dnf-automatic.timer; enabled; vendor preset: disabled)
Active: active (waiting) since Tue 2020-11-17 13:51:52 JST; 48s ago
Trigger: Wed 2020-11-18 06:31:29 JST; 16h left

11月 17 13:51:52 falcon21.space systemd[1]: Started dnf-automatic timer.


---------------------

ベース、開発ツールパッケージ群インストール
[root@falcon21 ~]# dnf -y groupinstall base "Development tools"
88個 インストール

-----------------------------

サービスの設定 初期設定
稼働中のサービスの一覧表示
[root@falcon21 ~]# systemctl -t service | more
UNIT LOAD ACTIVE SUB
DESCRIPTION
accounts-daemon.service loaded active running
Accounts Service
alsa-state.service loaded active running
Manage Sound Card State (restore and store)
atd.service loaded active running
Job spooling tools
auditd.service loaded active running
Security Auditing Service
avahi-daemon.service loaded active running
Avahi mDNS/DNS-SD Stack
chronyd.service loaded active running
NTP client/server
colord.service loaded active running
Manage, Install and Generate Color Profiles
crond.service loaded active running
Command Scheduler
cups.service loaded active running
CUPS Scheduler
dbus.service loaded active running
D-Bus System Message Bus
dracut-shutdown.service loaded active exited
Restore /run/initramfs on shutdown
gdm.service loaded active running
GNOME Display Manager

68 loaded units listed. Pass --all to see loaded but inactive units, too.
To show all installed unit files use 'systemctl list-unit-files'.

記載されている68のロードされたユニット。 --allを渡すと、ロードされているが非アクティブなユニットも表示されます。
インストールされているすべてのユニットファイルを表示するには、「systemct llist-unit-files」を使用します。

全サービスの一覧
[root@falcon21 ~]# systemctl list-unit-files -t service | more

httpd postfix などがインストールされてない

-----------------------------

投票数:0 平均点:0.00

 
Back to Top