LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 812|回复: 4

问两个问题,一个关于防火墙,一个关于网络对时。

[复制链接]
发表于 2009-6-12 10:31:24 | 显示全部楼层 |阅读模式
刚刚换回debian stable,

实在是受不了freebsd的编译了,

回到debian发现自己对debian的了解实在是有限啊,

比如不知道debian管理程序开机运行的机制,

所以来问问,

问题1:我打算给自己的电脑上一个iptables防火墙,这个东西应该是Linux内核提供的,debian默认的内核应该有了吧,是不是我只要写好规则就可以了呢?

debian的iptables的规则文件在什么位置呢?

问题2:我现在的电脑的时间总是慢一点,我想来个网络对时功能,

我该安装那个包?

我在搜了一下,不知道安装哪个好?

http://packages.debian.org/searc ... ble&section=all

ntpdate只是每次开机运行一次吧,

npt好像是做ntp-server用的,但是会不断的修正时间,

这些东西是不是安装以后就会自动开机运行呢?

但是我不是很确定,谁知道出来指点一下。
发表于 2009-6-12 14:01:10 | 显示全部楼层
debian下iptables规则没有默认的位置,你可以写入.sh里,然后放在任何位置。

安装的话,你只需配置好源然后apt-get install iptables就行啦,不用自己找包的。

是不是开机自己运行,你可以sysv-rc-conf查看
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-6-13 12:04:10 | 显示全部楼层
thk haha
回复 支持 反对

使用道具 举报

发表于 2009-6-13 12:28:08 | 显示全部楼层
ntpdate 是跃变式校正时间,运行后立即把时间调准,然后写入硬件就可以了。
  1. sudo ntpdate pool.ntp.org && sudo hwclock --systohc
复制代码


ntpd 是渐变式校正时间,服务器一般用这个,防止时钟跃变造成关键性程序错乱。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2009-6-13 13:04:04 | 显示全部楼层
For first question, I found this http://wiki.debian.org/iptables.

For the second, I habe been installed ntp and edited the ntp.conf file.
  1. [b]cat /etc/ntp.conf[/b]
  2. server 137.189.11.180 prefer
  3. server 137.189.11.181 prefer
  4. server 137.189.11.128 prefer
  5. server 61.129.66.79
  6. server 218.75.4.130
  7. server 218.21.130.42
  8. restrict default nomodify notrap noquery
  9. restrict 127.0.0.1
  10. restrict 137.189.11.180 mask 255.255.255.255 nomodify notrap noquery
  11. restrict 137.189.11.181 mask 255.255.255.255 nomodify notrap noquery
  12. restrict 137.189.11.128 mask 255.255.255.255 nomodify notrap noquery
  13. restrict 61.129.66.79 mask 255.255.255.255 nomodify notrap noquery
  14. restrict 218.75.4.130 mask 255.255.255.255 nomodify notrap noquery
  15. restrict 218.21.130.42 mask 255.255.255.255 nomodify notrap noquery
  16. [b]ntpq -p[/b]
  17.      remote           refid      st t when poll reach   delay   offset  jitter
  18. ==============================================================================
  19. *postman.itsc.cu 137.189.11.63    2 u   27   64  377   50.420  -54.686   4.342
  20. +envelope.itsc.c 137.189.11.63    2 u   36   64  377   50.509  -57.062   2.860
  21. ihome.cuhk.edu. .STEP.          16 u    - 1024    0    0.000    0.000   0.000
  22. x61.129.66.79    64.183.55.54     2 u   19   64  377  345.801  -213.07   1.640
  23. xHshh.org        216.218.192.202  2 u   54   64  337  443.233  -170.46   2.134
  24. 218.21.130.42   .STEP.          16 u    - 1024    0    0.000    0.000   0.000
复制代码
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表