← 返回命令列表

Linux command

semanage-interface 命令

安全

权限或系统影响较大,执行前请核对目标。

常用示例

List

sudo semanage interface -l

Add

sudo semanage interface -a -t type_name interface_name

Delete

sudo semanage interface -d interface_name

Modify

sudo semanage interface -m -t type_name interface_name

Example

sudo semanage interface -l -C

说明

semanage interface manages SELinux network interface type definitions. It assigns SELinux types to network interfaces for network-based access control. Interface labeling allows SELinux policies to control network traffic based on interface types.

参数

-l, --list
List interface type definitions
-a, --add
Add new definition
-d, --delete
Delete definition
-m, --modify
Modify existing definition
-t, --type _type_
SELinux type for interface
-C, --locallist
Show only local customizations
-D, --deleteall
Remove all local customizations
-E, --extract
Extract customizable commands for use in a transaction
-n, --noheading
Do not print heading when listing
-N, --noreload
Do not reload policy after commit
-r, --range _RANGE_
MLS/MCS security range (MLS/MCS systems only)

FAQ

What is the semanage-interface command used for?

semanage interface manages SELinux network interface type definitions. It assigns SELinux types to network interfaces for network-based access control. Interface labeling allows SELinux policies to control network traffic based on interface types.

How do I run a basic semanage-interface example?

Run `sudo semanage interface -l` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does -l, --list do in semanage-interface?

List interface type definitions