Re: [請益] 求救NATD中address_redirect設定的問題

看板FreeBSD作者時間20年前 (2005/07/25 02:01), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串4/9 (看更多)
※ 引述《petctman.bbs@ptt.cc (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 ──╯
文章代碼(AID): #12uzTr00 (FreeBSD)
討論串 (同標題文章)
文章代碼(AID): #12uzTr00 (FreeBSD)