Hi all,
I installed Chaos Calmer 15.05 on my DLink DIR300.
I followed the instructions in the guide doc/recipes/routedclient#using_masquerade to create a NATed subnet behind the DLink: here is a base schema
WWW <-----------> MODEM+AP <---------------------> DLink DIR300 with OWRT <--------> devices
(internet) ADSL 192.168.1.1 192.168.1.9 10.10.10.1 10.10.10.*
The steps performed have been (maybe can be useful for someone else in the future, since the guide seems a bit outdated):
uci del wireless.@wifi-device[0].disabled
uci del wireless.@wifi-iface[0].network
uci set wireless.@wifi-iface[0].mode=sta
uci commit wireless
wifi
iwlist scan doesn't work anymore
iw dev wlan0 scan
or
killall -9 wpa_supplicant
iw dev wlan0 scan
in case a message 'resource is busy' appears.
I use the info retrieved to setup the connection to the modem+AP on the wan interface:
config wifi-device 'wlan0'
option type 'mac80211'
option channel '12'
option hwmode '11g'
option path '10180000.wmac'
option htmode 'HT20'
config wifi-iface
option device 'wlan0'
option network 'wan'
option ssid 'Telecom-85785057'
option encryption 'psk'
option mode 'sta'
option key '***'
Then I setup my network interfaces with the following changes:
config interface 'lan'
option ifname 'eth0.1'
option force_link '1'
option macaddr '14:d6:4d:83:40:2c'
option type 'bridge'
option proto 'static'
# option ipaddr '192.168.1.1'
option ipaddr '10.10.10.1'
option gateway '192.168.1.1'
option netmask '255.255.255.0'
option ip6assign '60'
config interface 'wan'
# option ifname 'eth0.2'
option force_link '1'
option macaddr '14:d6:4d:83:40:2d'
# option proto 'dhcp'
option proto 'static'
option ipaddr '192.168.1.9'
option gateway '192.168.1.1'
option netmask '255.255.255.0'
pay attention to comment out the ifname option in the config interface of the wan interface!
Then I load the networks with:
/etc/init.d/network reload
Enable the wan interface::
ifup wan
wifi
Afterwards, I set up some rules in the firewall with:
# Create firewall rules and redirection in /etc/config/network
config rule
option name Allow_SSH_from_WAN
option src wan
option dest_ip 192.168.1.9/32
option dest_port 22
option proto tcp
option target ACCEPT
config redirect
option name Redir_LuCI
option src wan
option src_sport *
option src_dport 8080
option dest_ip 10.10.10.1
option dest_port 80
option proto tcp
config redirect
option name Redir_device1
option src wan
option src_sport *
option src_dport 80
option dest_ip 10.10.10.18
option dest_port 80
option proto tcp
Load the new rules with::
/etc/init.d/firewall reload
The firewall rules work like a charm: being inside the 192.168.1.0/24 network I'm able to access the LuCi interface of the DLink OWRT at the address: 192.168.1.9:8080 as expected.
The problem is that, inside the NATed network I cannot access the outside nor internet. E.g. when I try to ping or connect to a webserver outside the NATed network I get a:
# wget -q -O - 64.182.208.183:80
wget: can't connect to remote host (64.182.208.183): No route to host
(the result is the same even if I try to connect to a web server in the 192.168.1.0/24 network with # wget -q -O - 192.168.1.12:8080 )
The routing table is:
# route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 wlan0
10.10.10.0 0.0.0.0 255.255.255.0 U 0 0 0 br-lan
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
What am I missing? how should I implement a proper NAT?
(Last edited by bebo on 10 Jul 2017, 12:44)