Trying to make DNS work

David Samblas dsamblasomcommunity at gmail.com
Wed Oct 8 12:37:51 CEST 2008


El mié, 08-10-2008 a las 03:05 -0700, bum escribió:
> Hello, ubuntu and openmoko newcomer here.
> 
> I can successfully login to my freerunner with ssh and ping (ping
> 74.125.19.147) to the outside world but I can't ping to an address (ping
> www.google.com).
> 
> I've tried most of the things 
> http://wiki.openmoko.org/wiki/USB_Networking#Configure_Default_Neo_DNS here
> :
> My IP changes so I can't use "echo nameserver 'myIP' > /etc/resolv.conf".
> 
> echo nameserver 208.67.222.222 > /etc/resolv.conf
> echo nameserver 208.67.220.220 >> /etc/resolv.conf
> even if I don't understand it, but no luck. Getting error
> 
> "treeman at treeman-PC:~$ sudo echo nameserver 208.67.222.222 >
> /etc/resolv.conf
> bash: /etc/resolv.conf: Permission denied"
> 
> even with sudo... I dunno...
You have to do the echo stuff in the neo not in you pc
> 
> Tried placing
> "up echo nameserver 208.67.222.222 > /etc/resolv.conf
> up echo nameserver 208.67.220.220 >> /etc/resolv.conf"
> in "/etc/network/interfaces" but no luck.
this too has to be done in the neo
after the interface modification do the following to make it active
on the neo:
/etc/init.d/networking stop
/etc/init.d/networking start


> 
> Proxying from desktop/laptop is the thing I'd want though as I have a laptop
> :-D
> 
> Tried dnrd but don't know if I did it right...
> 
> treeman at treeman-PC:~$ sudo gedit /home/treeman/dnrd
> [sudo] password for treeman: 
> (paste  http://buildhost.automated.it/gta01 dnrd script )
> treeman at treeman-PC:~$ sudo chmod +x /home/treeman/dnrd
> treeman at treeman-PC:~$ sudo /home/treeman/dnrd
> /home/treeman/dnrd: line 97: -a: command not found
> 
> UDP forwarding link didn't work.
> 
> Iptables:
> iptables -t nat -A PREROUTING -p tcp -s 192.168.0.202 -d 192.168.0.200
> --dport domain -j DNAT --to-destination 192.168.0.1
> iptables -t nat -A PREROUTING -p udp -s 192.168.0.202 -d 192.168.0.200
> --dport domain -j DNAT --to-destination 192.168.0.1
> no errors but didn't work.
> 
> Also edited /etc/network/interfaces and added:
>  # freerunner
>  auto usb0
>  iface usb0 inet static
>         address 192.168.0.200
>         netmask 255.255.255.192
>         post-up /etc/network/freerunner start
>         pre-down /etc/network/freerunner stop
> 
> and /etc/network/freerunner:
>  #!/bin/sh
>  #
>  # configures the freerunner for internet
>  # 
>  # 
> 
>  DEVICE=usb0
>  IPADDR=192.168.0.200
>  REMOTE_IPADDR=192.168.0.202
>  NETMASK=255.255.255.0
> 
>  # get first ip for dns
>  DNSIP=$(cat /etc/resolv.conf | grep nameserver | awk '{ print $2 }' | head
> -n 1 )
> 
>  case "$1" in
>   start)
>         iptables -A POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR
>         iptables -A PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR
> --dport domain -j DNAT --to-destination $DNSIP
>         iptables -A PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d $IPADDR
> --dport domain -j DNAT --to-destination $DNSIP
>         
>         if [ "$(cat /proc/sys/net/ipv4/ip_forward)" = "0" ]; then
>                 echo "temoprarely allow ip_forward for openmoko" >
> /var/run/openmoko.ip_forward
>                 echo 1 > /proc/sys/net/ipv4/ip_forward
>         fi
>         ;;
>   stop)
>         iptables -D POSTROUTING -t nat -j MASQUERADE -s $REMOTE_IPADDR
>         iptables -D PREROUTING -t nat -p tcp -s $REMOTE_IPADDR -d $IPADDR
> --dport domain -j DNAT --to-destination $DNSIP
>         iptables -D PREROUTING -t nat -p udp -s $REMOTE_IPADDR -d  $IPADDR
> --dport domain -j DNAT --to-destination $DNSIP
> 
>         if [ -f /var/run/openmoko.ip_forward ]; then
>                 rm /var/run/openmoko.ip_forward
>                 echo 0 > /proc/sys/net/ipv4/ip_forward
>         fi
>         ;;
>  esac
> 
> Made executable with "chmod +x /etc/network/freerunner".
> 
> Also edited the ubuntu bug thing:
> "One can patch /etc/udev/rules.d/85-ifupdown.rules. Moving the DRIVERS=="*?"
> out of the top GOTO, to ACTION=="add" line fixes the problem."
> 
> Well there we go, I'm out of ideas and I've tried these steps more than
> once. I've rebooted and stuff and now I'm hoping for your help!
> 
> Regards, bum




More information about the support mailing list