2016-10-11 58 views
-1

我試圖完成以下設置:嘗試設置靜態IP塊與ATT Uverse和IP直通華碩路由器

NVG599 <>華碩RT-AC88U <>靜態設備

我有一個Ubuntu運行Apache的服務器已被配置爲使用內部地址192.xxx以及其中一個靜態IP地址。我知道Apache正在運行/收聽/工作。如果我瀏覽到內部地址,我會得到默認的Apache頁面。 Ubuntu防火牆已禁用。我實際上有一個指向此IP地址的域設置'http://thelavender.net'

通常,ATT RG將處理第二個子網/靜態IP塊。我無法弄清楚的是,華碩如何處理這些問題,現在它基本上承擔了所有的路由任務。

ATT RG有一個級聯路由器選項,我看到一些人在談論使用它。它是否正確?

編輯

回想起來,我覺得1:1 NAT是什麼,我真的需要在這裏正確嗎?

EDIT 2
我嘗試使用的東西沿着這行:

#!/bin/sh 
# 
# to restore this configuration, it needs to be saved to /jffs/scripts/nat-start 
# on the router. 
# 
ifconfig eth0:0 WanIP1 netmask 255.255.255.248 up 
iptables -t nat -A PREROUTING -i eth0 -d WanIP1 -j DNAT --to-destination  192.168.1.10 
iptables -t nat -I POSTROUTING -s 192.168.1.10 -j SNAT --to WanIP1 
# 
ifconfig eth0:1 WanIP2 netmask 255.255.255.248 up 
iptables -t nat -A PREROUTING -i eth0 -d WanIP2 -j DNAT --to-destination  192.168.1.11 
iptables -t nat -I POSTROUTING -s 192.168.1.11 -j SNAT --to WanIP2 
# 
ifconfig eth0:2 WanIP3 netmask 255.255.255.248 up 
iptables -t nat -A PREROUTING -i eth0 -d WanIP3 -j DNAT --to-destination 192.168.1.12 
iptables -t nat -I POSTROUTING -s 192.168.1.12 -j SNAT --to WanIP3 
# 
# Port forwards, in case the webui doesn't work, but i think it will. uncomment below if needed. 
# iptables -A FORWARD -p tcp --dport 80 -d 192.168.1.10 -j ACCEPT 

我只嘗試了第一組,並把這個在NAT啓動腳本梅林回暖。當我這樣做並重新啓動路由器時,它拒絕從RG獲取WAN IP。

任何幫助,這將不勝感激。

編輯

否決,但沒有解釋爲什麼。

回答

0

NVG599 LAN地址:192.168.0.254/255.255.255.0

RT-AC88U WAN地址:192.168.0.1/255.255.255.0 RT-AC88U LAN地址:192.168.1.1/255.255.255.0

NVG599級聯路由器:啓用 級聯路由器地址:192.168.0.1 網絡地址:107.218.164.224 子網掩碼:255.255.255.248

服務器:192.168.1.10和107.218.164.225

在路由器啓動腳本:

#!/bin/sh 
# 
# tell it where to find the server 

ip ro add 107.218.164.225/32 via 192.168.1.10 
iptables -I POSTROUTING -t nat -s 107.218.164.225/32 -j RETURN 

# 
# servers 2-N go here 
...... 
# 
# catch-all for everything else on the LAN 
# 
# this will double-NAT everything and will end up using the NVG's dynamic IP which is outside of the static IP block 
##iptables -A POSTROUTING -t nat -o eth0 -j SNAT --to 192.168.0.1 
# 
# this uses one of the public IPs 
iptables -A POSTROUTING -t nat -o eth0 -j SNAT --to 107.218.164.230 

而且腳本服務器如果需要的話

#!/bin/sh 
# 
ifconfig eth0:1 107.218.164.225/29 
ip ro repl default via 192.168.1.1 src 107.218.164.225