Raspberry Pi(一種)依存ポータル

Raspberry Pi(一種)依存ポータル

RPi3を使用して依存ポータルを構築しようとしています。私はまずアクセスポイントの指示に従ってください。次に、wlan0のすべてのトラフィックが自分自身を指すようにdnsmasqを設定しました。echo 'address=/#/172.24.1.1' >> /etc/dnsmasq.conf

接続すると、すべてのトラフィックがマイノードアプリケーションにリダイレクトされます。今これは私の問題が始まるところです。 Raspberry Piで発生したトラフィックを含むすべてのトラフィックはマイノードアプリに送信されるため、ボックス内にリモートでWebサイトにログインしたり、アプリをインストールしたりすることはできません。

問題はiptableルールにあると思います。

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE  
iptables -A FORWARD -i eth0 -o wlan0 -m state --state RELATED,ESTABLISHED -j ACCEPT  
iptables -A FORWARD -i wlan0 -o eth0 -j ACCEPT  

インターネットを通過するには、Raspberry Piのすべてのトラフィックが必要であり、eth0すべての着信トラフィックがwlan0マイノードアプリケーションにリダイレクトされ続ける必要があります。

修正する:

結果は次のとおりです。ip route sh

default via 10.1.10.1 dev eth0  metric 202 
10.1.10.0/24 dev eth0  proto kernel  scope link  src 10.1.10.87  metric 202 
172.24.1.0/24 dev wlan0  proto kernel  scope link  src 172.24.1.1 

私が使用している依存ポータルソフトウェアへの答えは「いいえ」です。私は私が書いたNode JSアプリケーションに取り組んでいます。これは、すべてのパスをページにリダイレクトするシンプルなExpress JSアプリケーションです。

dnsmasq.conf

interface=wlan0                     # Use interface wlan0  
listen-address=172.24.1.1           # Explicitly specify the address to listen on  
bind-interfaces                     # Bind to the interface to make sure we aren't sending things elsewhere  
#server=8.8.8.8                     # Forward DNS requests to Google DNS  
domain-needed                       # Don't forward short names  
bogus-priv                          # Never forward addresses in the non-routed address spaces.  
dhcp-range=172.24.1.50,172.24.1.150,12h     # Assign IP addresses between 172.24.1.50 and 172.24.1.150 with a 12 hour lease time
address=/#/172.24.1.1

IPテーブル

Chain INPUT (policy ACCEPT)
target     prot opt source               destination         

Chain FORWARD (policy ACCEPT)
target     prot opt source               destination         

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination      

ベストアンサー1

おすすめ記事