免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12
最近访问板块 发新帖
楼主: banyao
打印 上一主题 下一主题

我的PF死活nat不出去! [复制链接]

论坛徽章:
0
11 [报告]
发表于 2007-09-24 10:50 |只看该作者
http://bbs.chinaunix.net/thread-994768-1-2.html    是不是忘記改這個啦!!!

#vi /etc/sysctl.conf
net.inet.ip.frowarding=1

论坛徽章:
0
12 [报告]
发表于 2007-09-24 10:59 |只看该作者
在/etc/rc.conf中设置gateway_enable="YES"
和楼上的作用上一样的

论坛徽章:
0
13 [报告]
发表于 2007-09-24 11:14 |只看该作者
和楼上的作用上一样的#vi /etc/sysctl.conf
net.inet.ip.frowarding=1
这个是nat转发吧,早就已经打开了

论坛徽章:
0
14 [报告]
发表于 2007-09-24 11:16 |只看该作者
刚才把rc.conf中有route的选项都打开了,重启下,把结果帖上来卡看,希望可以解决

  1. # cat rc.conf
  2. #!/bin/sh -
  3. #
  4. #       $OpenBSD: rc.conf,v 1.123 2007/02/27 16:21:29 beck Exp $

  5. # set these to "NO" to turn them off.  otherwise, they're used as flags
  6. routed_flags=YES                # for normal use: "-q"
  7. ripd_flags=NO           # for normal use: ""
  8. mrouted_flags=YES       # for normal use: "", if activated
  9.                         # be sure to enable multicast_router below.
  10. dvmrpd_flags=NO         # for normal use: ""
  11. ospfd_flags=NO          # for normal use: ""
  12. bgpd_flags=NO           # for normal use: ""
  13. rarpd_flags=NO          # for normal use: "-a"
  14. bootparamd_flags=NO     # for normal use: ""
  15. rbootd_flags=NO         # for normal use: ""
  16. sshd_flags=""           # for normal use: ""
  17. named_flags=NO          # for normal use: ""
  18. rdate_flags=NO          # for normal use: [RFC868-host] or [-n RFC2030-host]
  19. timed_flags=NO          # for normal use: ""
  20. ntpd_flags=NO           # for normal use: ""
  21. isakmpd_flags=NO        # for normal use: ""
  22. sasyncd_flags=NO        # for normal use: ""
  23. mopd_flags=NO           # for normal use: "-a"
  24. apmd_flags=NO           # for normal use: ""
  25. dhcpd_flags=NO          # for normal use: ""
  26. dhcrelay_flags=NO       # for normal use: "-i interface [server]"
  27. rtadvd_flags=NO         # for normal use: list of interfaces
  28.                         # be sure to set net.inet6.ip6.forwarding=1
  29. route6d_flags=NO        # for normal use: ""
  30.                         # be sure to set net.inet6.ip6.forwarding=1
  31. rtsold_flags=NO         # for normal use: interface
  32.                         # be sure to set net.inet6.ip6.forwarding=0
  33.                         # be sure to set net.inet6.ip6.accept_rtadv=1
  34. lpd_flags=NO            # for normal use: "" (or "-l" for debugging)
  35. sensorsd_flags=NO       # for normal use: ""
  36. hotplugd_flags=NO       # for normal use: ""
  37. watchdogd_flags=NO      # for normal use: ""
  38. ftpproxy_flags=NO       # for normal use: ""
  39. hostapd_flags=NO        # for normal use: ""
  40. ifstated_flags=NO       # for normal use: ""
  41. hoststated_flags=NO     # for normal use: ""

  42. # use -u to disable chroot, see httpd(8)
  43. httpd_flags=NO          # for normal use: "" (or "-DSSL" after reading ssl(8))

  44. # For normal use: "-L sm-mta -bd -q30m", and note there is a cron job
  45. sendmail_flags="-L sm-mta -C/etc/mail/localhost.cf -bd -q30m"
  46. sendmail_flags=NO
  47. spamd_flags=NO          # for normal use: "" and see spamd-setup(8)
  48. spamd_black=NO          # set to YES to run spamd without greylisting
  49. spamlogd_flags=""       # use eg. "-i interface" and see spamlogd(8)

  50. # Set to NO if ftpd is running out of inetd
  51. ftpd_flags=NO           # for non-inetd use: "-D"

  52. # Set to NO if identd is running out of inetd
  53. identd_flags=NO         # for non-inetd use: "-b -elo"

  54. # On some architectures, you must also disable console getty in /etc/ttys
  55. xdm_flags=NO            # for normal use: ""

  56. # For enabling console mouse support (i386 alpha amd64)
  57. wsmoused_flags=NO       # for ps/2 or usb mice: "", serial: "-p /dev/cua00"

  58. # set the following to "YES" to turn them on
  59. rwhod=NO
  60. nfs_server=NO           # see sysctl.conf for nfs client configuration
  61. lockd=NO
  62. amd=NO
  63. pf=YES                  # Packet filter / NAT
  64. ipsec=NO                # IPsec
  65. portmap=NO              # Note: inetd(8) rpc services need portmap too
  66. inetd=YES               # almost always needed
  67. check_quotas=YES        # NO may be desirable in some YP environments
  68. accounting=NO           # process accounting (using /var/account/acct)

  69. krb5_master_kdc=NO      # KerberosV master KDC. Run 'info heimdal' for help.
  70. krb5_slave_kdc=NO       # KerberosV slave KDC.
  71. afs=NO                  # mount and run afs

  72. # Multicast routing configuration
  73. # Please look at netstart(8) for a detailed description if you change these
  74. multicast_host=YES      # Route all multicast packets to a single interface
  75. multicast_router=YES    # A multicast routing daemon will be run, e.g. mrouted

  76. # miscellaneous other flags
  77. # only used if the appropriate server is marked YES above
  78. savecore_flags=                 # "-z" to compress
  79. ypserv_flags=                   # E.g. -1 for YP v1, -d for DNS etc
  80. yppasswdd_flags=NO              # "-d /etc/yp" if passwd files are in /etc/yp
  81. nfsd_flags="-tun 4"             # Crank the 4 for a busy NFS fileserver
  82. amd_dir=/tmp_mnt                # AMD's mount directory
  83. amd_master=/etc/amd/master      # AMD 'master' map
  84. syslogd_flags=                  # add more flags, ie. "-u -a /chroot/dev/log"
  85. pf_rules=/etc/pf.conf           # Packet filter rules file
  86. ipsec_rules=/etc/ipsec.conf     # IPsec rules file
  87. pflogd_flags=                   # add more flags, ie. "-s 256"
  88. afsd_flags=                     # Flags passed to afsd
  89. shlib_dirs=                     # extra directories for ldconfig, separated
  90.                                 # by space

  91. local_rcconf="/etc/rc.conf.local"

  92. [ -f ${local_rcconf} ] && . ${local_rcconf} # Do not edit this line
  93. #
复制代码

论坛徽章:
0
15 [报告]
发表于 2007-09-24 11:19 |只看该作者
all tcp 192.168.188.8:2430 -> 192.168.135.234:63709 -> 220.181.29.154:80       ESTABLISHED:SYN_SENT
从路由表上看来应该是转发出去成功了啊,怎么就不把数据包转发回来?? 搞不懂

  1. STATES:
  2. all icmp 192.168.188.1:512 <- 192.168.188.8       0:0
  3. all udp 192.168.188.1:520 -> 192.168.188.255:520       SINGLE:NO_TRAFFIC
  4. all udp 192.168.188.255:520 <- 192.168.188.1:520       NO_TRAFFIC:SINGLE
  5. all udp 192.168.135.234:520 -> 10.5.5.5:520       SINGLE:NO_TRAFFIC
  6. all udp 192.255.255.255:138 <- 192.168.18.126:138       NO_TRAFFIC:SINGLE
  7. all tcp 192.168.188.1:22 <- 192.168.188.8:2409       ESTABLISHED:ESTABLISHED
  8. all udp 255.255.255.255:5678 <- 192.168.0.25:5678       NO_TRAFFIC:SINGLE
  9. all udp 192.255.255.255:138 <- 192.168.18.54:138       NO_TRAFFIC:SINGLE
  10. all udp 255.255.255.255:67 <- 0.0.0.0:68       NO_TRAFFIC:SINGLE
  11. all udp 192.255.255.255:137 <- 192.168.18.47:137       NO_TRAFFIC:SINGLE
  12. all udp 192.255.255.255:137 <- 192.168.18.36:137       NO_TRAFFIC:SINGLE
  13. all tcp 202.108.22.46:80 <- 192.168.188.8:2424       CLOSED:SYN_SENT
  14. all tcp 192.168.188.8:2424 -> 192.168.135.234:54102 -> 202.108.22.46:80       ESTABLISHED:SYN_SENT
  15. all udp 192.255.255.255:138 <- 192.168.18.70:138       NO_TRAFFIC:SINGLE
  16. all tcp 58.60.11.54:80 <- 192.168.188.8:2426       CLOSED:SYN_SENT
  17. all tcp 192.168.188.8:2426 -> 192.168.135.234:60237 -> 58.60.11.54:80       ESTABLISHED:SYN_SENT
  18. all tcp 58.60.13.71:80 <- 192.168.188.8:2427       CLOSED:SYN_SENT
  19. all tcp 192.168.188.8:2427 -> 192.168.135.234:64131 -> 58.60.13.71:80       ESTABLISHED:SYN_SENT
  20. all udp 192.255.255.255:138 <- 192.168.18.36:138       NO_TRAFFIC:SINGLE
  21. all tcp 220.181.29.154:80 <- 192.168.188.8:2430       CLOSED:SYN_SENT
  22. all tcp 192.168.188.8:2430 -> 192.168.135.234:63709 -> 220.181.29.154:80       ESTABLISHED:SYN_SENT
  23. all udp 192.168.18.255:137 <- 192.168.18.222:137       NO_TRAFFIC:SINGLE
  24. all tcp 58.60.15.222:80 <- 192.168.188.8:2432       CLOSED:SYN_SENT
  25. all tcp 192.168.188.8:2432 -> 192.168.135.234:54213 -> 58.60.15.222:80       ESTABLISHED:SYN_SENT
  26. all udp 192.255.255.255:138 <- 192.168.18.28:138       NO_TRAFFIC:SINGLE
  27. all udp 192.255.255.255:138 <- 192.168.18.85:138       NO_TRAFFIC:SINGLE
  28. all tcp 121.14.73.120:80 <- 192.168.188.8:2434       CLOSED:SYN_SENT
  29. all tcp 192.168.188.8:2434 -> 192.168.135.234:64914 -> 121.14.73.120:80       ESTABLISHED:SYN_SENT
  30. all udp 192.255.255.255:137 <- 192.168.18.51:137       NO_TRAFFIC:SINGLE
  31. all udp 192.255.255.255:137 <- 192.168.18.3:137       NO_TRAFFIC:SINGLE
  32. all udp 192.255.255.255:138 <- 192.168.18.26:138       NO_TRAFFIC:SINGLE
复制代码

[ 本帖最后由 banyao 于 2007-9-24 11:20 编辑 ]

论坛徽章:
0
16 [报告]
发表于 2007-09-24 11:42 |只看该作者
netstat -an

tcp        0      0  *.22                   *.*                    LISTEN
tcp        0      0  127.0.0.1.953          *.*                    LISTEN
tcp        0      0  192.168.188.1.53       *.*                    LISTEN
tcp        0      0  127.0.0.1.53           *.*                    LISTEN
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
udp        0      0  *.520                  *.*
udp        0      0  *.25981                *.*
udp        0      0  192.168.188.1.53       *.*
udp        0      0  127.0.0.1.53           *.*
udp        0      0  *.514                  *.*
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
tcp6       0      0  *.22                   *.*                    LISTEN
tcp6       0      0  ::1.953                *.*                    LISTEN
tcp6       0      0  *.53                   *.*                    LISTEN
Active Internet connections (including servers)
Proto Recv-Q Send-Q  Local Address          Foreign Address        (state)
udp6       0      0  *.22560                *.*
udp6       0      0  *.53                   *.*
Active UNIX domain sockets
Address    Type   Recv-Q Send-Q      Inode       Conn       Refs    Nextref Addr
0xd3ce7eec dgram       0      0        0x0 0xd0be0800 0xd0be0800        0x0
0xd3c42008 dgram       0      0        0x0 0xd0be0840 0xd0be0840        0x0
0xd3c421b0 dgram       0      0        0x0 0xd0b74440        0x0 0xd0ba9800
0xd3ce7d44 stream      0      0 0xd3cc91d4        0x0        0x0        0x0 tabs                                             /.sock
0xd3ce7c70 dgram       0      0        0x0 0xd0b74440        0x0 0xd0ba9c80
0xd3ce79f4 dgram       0      0        0x0 0xd0b74440        0x0 0xd0ba9980
0xd3ce74fc stream      0      0        0x0 0xd0ba91c0        0x0        0x0
0xd3ce7428 stream      0      0        0x0 0xd0ba9180        0x0        0x0
0xd3ce7354 dgram       0      0        0x0 0xd0b74440        0x0 0xd0b74900
0xd3d1eac4 dgram       0      0        0x0 0xd0b74440        0x0 0xd0b8ef80
0xd3d1e91c stream      0      0        0x0 0xd0b42f00        0x0        0x0
0xd3d1e848 stream      0      0        0x0 0xd0b74540        0x0        0x0
0xd3d1e774 dgram       0      0        0x0 0xd0b74440        0x0 0xd0b8e700
0xd3d1e6a0 dgram       0      0        0x0 0xd0b74440        0x0        0x0
0xd3d1e5cc stream      0      0        0x0 0xd0b8e540        0x0        0x0
0xd3d1e4f8 stream      0      0        0x0 0xd0b8e440        0x0        0x0
0xd3d1e424 stream      0      0        0x0 0xd0b8eac0        0x0        0x0
0xd3d1e350 stream      0      0        0x0 0xd0b8ef00        0x0        0x0
0xd3d1e27c dgram       0      0 0xd3cf509c        0x0        0x0        0x0 /var                                             /empty/dev/log
0xd3d1e1a8 dgram       0      0 0xd3cf5000        0x0        0x0        0x0 /var                                             /named/dev/log
0xd3d1e0d4 dgram       0      0 0xd3cf9f3c        0x0 0xd0be0b40        0x0 /dev                                             /log
#

论坛徽章:
0
17 [报告]
发表于 2007-09-26 10:54 |只看该作者
没人理会我。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP