OpenWrt Forum Archive

Topic: NAT not working

The content of this topic has been archived on 17 Mar 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi guys,
          Im using a WRT54G V2 which ive flashed with WhiteRussian RC2.  Im connecting via PPPoE which is configured and working correctly, the router is connected, assigned DNS etc and has full connectivity via the WAN port.

The LAN is configured as default on 192.168.1.0/24 running DHCP and DNSMASQ which both appear to be working fine.

Clients on the LAN are assigned IPs/DNS etc and can do DNS lookups without problem via the wrt54g.

However, the NAT rules dont appear to be working as LAN clients have no internet access, their default gateway is set correctly to 192.168.1.1

Ive searched the forums and cant seem to find anything related to this, ive tried a factory reset erasing the NVRAM variables are configuring from the start but the same problem appears.

Anyone got any ideas or seen this before?

Ive included the output from nvram show below if its of any help ;-)

Regards

Ben

root@OpenWrt:~# uname -a
Linux OpenWrt 2.4.30 #1 Mon Jul 18 17:43:36 EDT 2005 mips unknown

root@OpenWrt:~# nvram show
os_ram_addr=80001000
boardrev=0x10
il0macaddr=00:0f:66:d9:69:2f
ppp_passwd=removed
ppp_idletime=0
et0macaddr=00:0F:66:D9:69:2D
boot_wait=off
watchdog=5000
et0mdcport=0
pmon_ver=CFE 3.51.21.0
ppp_username=benoh@plusdsl.net
gpio2=adm_eecs
gpio3=adm_eesk
gpio5=adm_eedi
vlan0ports=1 2 3 4 5*
gpio6=adm_rc
os_flash_addr=bfc40000
sromrev=2
boardtype=0x0101
lan_netmask=255.255.255.0
ppp_redialperiod=0
wl0id=0x4320
ag0=255
wl0gpio2=0
wl0gpio3=0
boardflags2=0
wan_proto=pppoe
pa0itssit=62
cctl=0
lan_ifnames=vlan0 eth1
pppoe_ifname=vlan1
pa0maxpwr=0x48
clkfreq=200
lan_ipaddr=192.168.1.1
vlan1hwname=et0
aa0=3
pppoe_passwd=removed
sdram_config=0x0032
vlan1ports=0 5
scratch=a0180000
ccode=0
pppoe_idletime=0
lan_ifname=br0
boardflags=0x0188
sdram_refresh=0x0000
sdram_ncdl=0x22
pppoe_username=benoh@plusdsl.net
et0phyaddr=30
wan_ifname=vlan1
pa0b0=0x170c
pa0b1=0xfa24
pa0b2=0xfe70
sdram_init=0x0000
vlan0hwname=et0
dl_ram_addr=a0001000
boot_ver=v2.3
boardnum=42
size: 980 bytes (31788 left)

root@OpenWrt:~# ifconfig -a
br0       Link encap:Ethernet  HWaddr 00:0F:66:D9:69:2D
          inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16455 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4077 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1283345 (1.2 MiB)  TX bytes:703682 (687.1 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0F:66:D9:69:2D
          UP BROADCAST RUNNING PROMISC MULTICAST  MTU:1500  Metric:1
          RX packets:18280 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5942 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1912436 (1.8 MiB)  TX bytes:967579 (944.9 KiB)
          Interrupt:5 Base address:0x2000

eth1      Link encap:Ethernet  HWaddr 00:0F:66:D9:69:2F
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:209
          TX packets:0 errors:12149 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:4 Base address:0x1000

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

ppp0      Link encap:Point-Point Protocol
          inet addr:84.92.97.160  P-t-P:195.166.128.64  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1492  Metric:1
          RX packets:1450 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1480 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:196835 (192.2 KiB)  TX bytes:195837 (191.2 KiB)

vlan0     Link encap:Ethernet  HWaddr 00:0F:66:D9:69:2D
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16456 errors:0 dropped:0 overruns:0 frame:0
          TX packets:4077 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:1349247 (1.2 MiB)  TX bytes:719990 (703.1 KiB)

vlan1     Link encap:Ethernet  HWaddr 00:0F:66:D9:69:2D
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1819 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1865 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:233515 (228.0 KiB)  TX bytes:247589 (241.7 KiB)


root@OpenWrt:~# iptables -L
Chain INPUT (policy DROP)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere            state INVALID
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
DROP       tcp  --  anywhere             anywhere            tcp option=!2 flags:SYN/SYN
input_rule  all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     icmp --  anywhere             anywhere
ACCEPT     gre  --  anywhere             anywhere
REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable

Chain FORWARD (policy DROP)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere            state INVALID
TCPMSS     tcp  --  anywhere             anywhere            tcp flags:SYN,RST/SYN TCPMSS clamp to PMTU
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
forwarding_rule  all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere

Chain OUTPUT (policy DROP)
target     prot opt source               destination
DROP       all  --  anywhere             anywhere            state INVALID
ACCEPT     all  --  anywhere             anywhere            state RELATED,ESTABLISHED
output_rule  all  --  anywhere             anywhere
ACCEPT     all  --  anywhere             anywhere
REJECT     tcp  --  anywhere             anywhere            reject-with tcp-reset
REJECT     all  --  anywhere             anywhere            reject-with icmp-port-unreachable

Chain forwarding_rule (1 references)
target     prot opt source               destination

Chain input_rule (1 references)
target     prot opt source               destination

Chain output_rule (1 references)
target     prot opt source               destination

Read the FAQ (41. How do I configure pppoe?)

Basically, you need this :

nvram set wan_ifname=ppp0

The firewall scripts look at the nvram variable wan_ifname, by default, to find out what interface you want to use as your outside interface.  If your wan_ifname variable does not point to your outside interface(which should be your PPPoE(ppp0) interface, then you won't get proper routing....

(Last edited by hitek146 on 7 Sep 2005, 10:34)

Cheers for the replies, it looks blindingly obvious now ;-)

However, im fairly sure it was set to ppp0 after the initial install but pppd was erroring into syslog as it couldnt find the interface, hence i changed it to vlan1 to get it connected.

Ill change it over and see how it goes from there.

Cheers again,

Ben

The discussion might have continued from here.