linux中pf命令 f linux命令( 二 )


used to notify the client when a network interface has been added or removed, so
that the client can attempt to configure an IP address on that
interface.
-n
The DHCP client can be directed not to attempt to configure any
interfaces using the -n flag. This is most likely to be useful in combination
with the -w flag.
-nw
The client can also be instructed to become a daemon immediately,
rather than waiting until it has acquired an IP address. This can be done by
supplying the -nw flag.
-e
The client runs child processes (scripts) with a clean
environment. Use the -e flag to specify additional environment variables to pass
to child processes.
linux
dhclient 的演示示例:
dhclient
eth0
Renews
the IP address.
Linux
renew ip command
$
sudo dhclient -r //release ip 释放IP
$
sudo dhclient //获取IP
在MacOS上使用1024以下端口MacOS和Linux一样,需要root权限使用低于1024以下端口 。因此要在Mac机器上监听80端口或443端口 , 要么以root用户启动应用,要么使用端口转发 。
在Linux系统中可以通过 sudo setcap cap_net_bind_service=+ep app name 来让非root用户使用1024以下端口(app name指要授权监听端口的程序) 。
MacOS没有 setcap 命令,所以需要通过端口转发来达到目的 。新版的MacOS操作系统使用pf(packet filter)设置端口转发 。
??注意,以下示例端口有重复 。
示例一:
/etc/pf.anchors/http
示例二:
/etc/pf.anchors/tomcat
示例三:
/etc/pf.anchors/virtualbox
pf启动时会自动装载 /etc/pf.conf 文件,因此将anchor文件链接到 /etc/pf.conf ,转发规则就会自动建立了 。pf.conf对指令的顺序有严格要求 , 相同的指令需要放在一起,否则会报错 Rules must be in order: options, normalization, queueing, translation, filtering.
pf默认是关闭的 。可以使用以下命令启动pf:
使用 -e 命令启用 pf 服务 。使用 -E 命令强制重启 pf 服务:
使用 -d 命令关闭 pf:
修改 LaunchDaemons ( 《了解LaunchDaemons》 )来使 pf 开机自动打开
添加的为-e参数,即enable 。有一点一定要注意,-f和 etc/pf.conf 这两个参数不能被打断,因为-f必须紧跟一个文件参数,所以说添加-e参数时不要打断-f参数 , 否则开机不会自动启动pf,切记 。
如果需要跨接口转发,则需设置系统参数:/etc/sysctl.conf
开机启动配置,需以 root 身份添加或修改/etc/sysctl.conf文件,加入以下两行:
开启端口转发之后,即可配置端口转发规则 。你可以跟着手册来:
在Linux中,如何从ext3文件系统转至ext4文件系统.(不破坏数据).您好: Linux文件系统从ext3升级到ext4
 尽管
ext4
出来已经有一段时间linux中pf命令了linux中pf命令,由于有一些
bug
还没被大量应用到服务器生产环境中linux中pf命令,不过对于桌面用户来说
ext4
已经足够成熟了 。去年发布linux中pf命令的最新
RHEL
5.4
版本默认文件系统依然是
ext3 。
最近
Linux
内核开发人员、ext4
文件系统的维护者
Ted
Ts’o
跳槽到
Google,并在
Google
继续从事
ext4
的研发和
Linux
kernel
方面的工作 。在一篇
mailing
list
里,Google
工程师
Michael
Rubin
也提到了一些
Google
内部使用
【linux中pf命令 f linux命令】ext4
的情况 。经过
Google
内部测试,ext4
和高性能的
xfs
文件系统性能很接近,Google

推荐阅读