※ 引述《[email protected] (改啃"組合語言"中~(難吃))》之銘言:
: 而我要如何設定 BSD 才能使我 192.168.0.0/24 網段的使用者凡是連線至
: 192.168.100.0/24 網段皆由 192.168.2.254 ROUTE 2 繞送封包
: 反之不是到那邊去的封包皆由 BSD 的 NAT 轉遞封包至 203.75.53.254 ROUTE 1
1. 先在 /etc/rc.conf 設定 defaultrouter="203.75.53.254"
2. 然後在 /usr/local/etc/rc.d/ 放入以下的script ...
route add -net 192.168.100.0/24 -host 192.168.2.254 -static
或是直接寫在 rc.conf 裡...
像是這樣...詳情請man rc.conf , 找和route有關說明...
static_routes="companynet"
route_companynet="-net 192.168.100.0/24 -host 192.168.2.254 -static"
: ●網路架構示意圖:
: Router 1 與 Router 2 皆為 Cisco 實體。
: Router 1 : 203.73.53.254 /24
: Router 2 : 192.168.2.254 /24
:
: ┌──────┐ xl0┌──────┐xl1 ┌──────┐
: │ Router 1 ├───┤ FreeBSD ├───┤ Router 2 │
: └──────┘ └───┬──┘ └──────┘
: │xl2
: ┌───────┐ │
: │ Switch/HUB ├──────┘
: └┬┬┬┬┬┬┬┘ xl0 203.73.53.1
: ┌ ┴ ┴ ┴ ┴ ┐ xl1 192.168.2.1
: Private network xl2 192.168.0.254
: └ ─ ─ ─ ─ ┘ FreeBSD 的 Default_gateway 203.73.53.254
--
※ Origin: 鳥窩 (BirdNest.twbbs.org) ◆ From: 140.128.192.5