看板FreeBSD
标 题Re: [请益] 求救NATD中address_redirect设定的问题
发信站脆笛酥的家 (Sun Jul 24 23:47:53 2005)
转信站ptt!ctu-reader!ctu-peer!Spring!news.nctu!news.ntu!news.au!JAL
※ 引述《[email protected] (poincare)》之铭言:
有东西少写
[写的好复杂....]
> 因为在同一个switch下有两组不同的ip,因此kernel一直鬼叫说不对的interface收到
> 不对的封包。但无论如何,网路是通的,因此我把/etc/sysconf.conf中的/dev/console
> 改为/dev/null
上面是错误的示范,这样改所有讯息通通都不见了
/etc/sysctl.conf
net.link.ether.inet.log_arp_wrong_iface=0
# reboot
or
# sysctl net.link.ether.inet.log_arp_wrong_iface=0
--------------------------------------------------------------
> 接着我把natd打开(kernel已设定好,加入了IPFIREWALL和IPDIVERT两个option)
> /etc/default/rc.conf中的设定设好,即gateway, firewall, natd都打开
> natd连接到internet的interface设定为vr0
/etc/natd.conf
interface vr0
redirect_port tcp 10.10.10.x:80 140.116.99.x:3000
redirect_port tcp 10.10.10.x:1881-1999 140.116.99.x:1881-1999
redirect_port udp 10.10.10.x:1881-1999 140.116.99.x:1881-1999
上面这堆是范例,自己照样造句吧
其实不只可以转到虚拟的 IP 去,还可以转到真实的IP去,这招也很好用
执行
# /sbin/natd -f /etc/natd.conf -n vr0
或是等改完下面的之後 reboot
----------------------------------------------------------------
/etc/rc.conf
gateway_enable="YES"
natd_enable="YES"
natd_flags="-f /etc/natd.conf" #natd config file
natd_interface="vr0"
---
公司的 IP 怎麽会是成大的IP网段来着
--
╰╮ Υ小瓜呆的窝.脆笛酥的家Υ ╭╯
╭╯ 作者:jal 来自:jal-tw.ddo.jp ╰╮
╰── 192.192.120.29 ──┤jal-BBS├── bbs.jal.idv.tw ──╯