OpenWrt Forum Archive

Topic: kamikaze 7.09, x.x.x.254 gateway and dns entries

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

Hi,

there is a thread (http://forum.openwrt.org/viewtopic.php?id=11451) which mentions to put x.x.x.254 entries for gateway and dns into /etc/config/network and another one (http://forum.openwrt.org/viewtopic.php?id=11909) where this is said to be unneccessary.

I can only state that my setup (which is standard, I think) doesn't work without them. It is an asus wl-500gp with pppoe to a dsl modem on the wan side. I do use

#### VLAN configuration 
config switch eth0
    option vlan0    "1 2 3 4 5*"
    option vlan1    "0 5"


#### Loopback configuration
config interface loopback
    option ifname    "lo"
    option proto    static
    option ipaddr    127.0.0.1
    option netmask    255.0.0.0


#### LAN configuration
config interface lan
    option type     bridge
    option ifname    "eth0.0"
    option proto    static
    option ipaddr    '192.168.23.69'
    option netmask    255.255.255.0
    option gateway    '192.168.23.254'
    option dns    '192.168.23.254'

#### WAN configuration
config interface    wan
    option ifname    "eth0.1"
    option proto    'pppoe'
    option username    'username'
    option password    'password'

Without those two entries I can only access the internet from the router, but not from a machine in the lan. I am quite surprised that those lines are needed for basic functionality but are not included in the default config and are not mentioned in any documentation except the post mentioned above.

So what do those entries do? What is the reason that I need to add them for a standard router config? Or maybe there is something else wrong with my setup?

Best regards,
Jens

What is the difference between the following with and without those two lines?

ifconfig -a
netstat -rn
iptables -t nat -nvL
iptables -nvL

i.e. run those commands, then remove the lines and reboot and run the commands again.  Find the differences.  That should explain what's going on.

Also you could try with just the gateway and with just the dns option to see what each one does by itself.

EDIT: Maybe also see what changes in /tmp/resolv.conf*

(Last edited by Wodin on 27 Feb 2008, 07:46)

Hello Wodin,

thanks a lot for your answer. I used the following script to help testing it

cat /bin/netzwerktest.sh > /tmp/nw.txt
echo "---- trenner" >> /tmp/nw.txt
cat /etc/config/network >> /tmp/nw.txt
echo "---- trenner" >> /tmp/nw.txt
ifconfig -a >> /tmp/nw.txt
echo "---- trenner" >> /tmp/nw.txt
netstat -rn >> /tmp/nw.txt
echo "---- trenner" >> /tmp/nw.txt
iptables -t nat -nvL >> /tmp/nw.txt
echo "---- trenner" >> /tmp/nw.txt
iptables -nvL >> /tmp/nw.txt
for n in /tmp/resolv*
  do
    echo "---- trenner: ${n}" >> /tmp/nw.txt
    cat ${n} >> /tmp/nw.txt
done

and while doing it I had to find out that this time it works without both of those entries in question. I am really surprised as I did install OpenWrt three times, documented every step in every install and had to use those entries every time to get a working connection. Really strange.

So I just stop trying different combinations now. However, a partial result: the line

config interface lan
    option dns    '192.168.23.254'

just results in

nameserver 192.168.23.254

being added to /tmp/resolv.conf.

Well, I've been curious and reenabled both lines: the gateway line does not make any difference in the script's output?!?! Yes, I did a "uci commit network" and did even reboot the router...

Best regards,
Jens

(Last edited by pflantz on 28 Feb 2008, 17:40)

Hello,

I have the same problem. I use OpenWRT on a WRT54GL and have a DNS problem too.
Wan to internet work. Lan to Internet work only if I config my eth0 at my Lan PC with the IP of the nameserver it is shown in /tmp/resolv.conf.auto it works.
All of my other Routers was able to handle the DNS IP from the Wan that the routers IP is the DNS IP for the PC

No, I don't have news, sorry.
Jens

The discussion might have continued from here.