找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 5548|回复: 10

求dd-wrt optware中 atftp 或者 tftp-hpa的启动方式

[复制链接]
发表于 2012-3-29 14:29 | 显示全部楼层 |阅读模式
求dd-wrt optware中 atftp 或者 tftp-hpa的启动方式


已经安装了atftp或tftp-hpa。但是不知道如何启动这个tftp服务。
有谁能给点提示???
 楼主| 发表于 2012-3-29 14:30 | 显示全部楼层
ps命令后发现服务没起来。


还有个问题想问问大家。在dd-wrt 如何寻找一个特定文件???? whereis 和 locate 好像都不起作用的。
 楼主| 发表于 2012-3-29 14:31 | 显示全部楼层
通过optware装了软件后都找不到安装目录和设置文件。{:soso_e101:}
发表于 2012-3-29 15:33 | 显示全部楼层
用type定位文件。

其实dnsmasq就可以了,自带tftp。简单的pxelinux载入没问题。winpe因为涉及到斜杠问题,可以考虑iso方式整体载入到内存。没问题路由android手机都可以

http://www.thekelleys.org.uk/dnsmasq/docs/dnsmasq.conf.example
 楼主| 发表于 2012-3-29 17:28 | 显示全部楼层
dnsmasq当然好了。可dd-wrt是不带tftp的。阉割了。这点好像很多用户都证实来 。
请问你确实试验过内置的dnsmasq的tftp能起来?  
 楼主| 发表于 2012-3-29 17:33 | 显示全部楼层
如果enable tftp 连dnsmasq进程都会被杀调。
迫于无奈才想安装第三方 tftp,有人声称是可行。只是
我不怎么明白他的方法 这是资料https://www.right.com.cn/forum/thread-50596-1-1.html
发表于 2012-3-29 23:04 | 显示全部楼层
哦。忘了是在 Tomato v1.28.9054 MIPSR2-beta K26 USB virtual**3.6

http://bbs.wuyou.com/viewthread. ... page%3D1&page=2
 楼主| 发表于 2012-3-30 03:09 | 显示全部楼层
[ 本帖最后由 buypro2 于 2012-3-30 04:16 编辑 ]

有个令类方法。
就是再装一份optware版本的dnsmasq 。
http://www.dd-wrt.com/phpBB2/viewtopic.php?p=660694

Posting this because it took me a bit of digging to figure out and I did not find a tutorial or howto anywhere else. There may be better ways, if that is the case please let me know - I am still a dd-wrt newb. Hopefully it helps a few of you. It might belong on the wiki but that does not want to let me create an account so I'm posting it here for now.

Here is how I did it and why:

Why: I had a dying computer that was hosting dnsmasq for my SOHO LAN. I have a few computers, some Android devices, VOIP, DNLA, blah blah blah going and I like dnsmasq for the control it gives me over DHCP and DNS. Caching DNS helps as well. I need to retire this poor old PC and move on. I'm not sure why but the built in dnsmasq did not like the configuration options I had in my old dnsmasq.conf and I got tired of trying to figure out what the problem was and decided to just use the optware version which as of this writing is the latest and greatest and is also the same as was running on my Ubuntu computer that was dying. I also had some static addresses that I wanted to assign, etc.


How: I upgraded the E3000 to the lastest 18xxx mega series software and then installed optware following the directions from Optware The Right Way on the wiki. http://www.dd-wrt.com/wiki/index.php/Optware%2C_the_Right_Way

Everything works fine for me at this point except dnsmasq which as I said above, doesn't like whatever I am trying to do.

Once installing optware core was complete I ran into a couple of challenges.

1. How to get the new dnsmasq installed? I'm new to optware and so wasn't real sure.
2. How to get the installed optware version of dnsmasq working?
3. How to get the default to stay shutdown?
4. How to get the optware version to run at startup.

So, I am not a newb when it comes to linux but as I said I am new to dd-wrt and optware.

The blow by blow:

To find out what packages are available (optware must be installed and working) use ipkg:
Code:
ipkg list

That is going to be a ton of crap so try this:
Code:
ipkg list|grep dnsmasq

and you should get this:
Code:
root@fsmsouth:~# ipkg list|grep dnsmasq
dnsmasq - 2.59-1 - DNS and DHCP server


OK, so now install it:
Code:
root@fsmsouth:~# ipkg install dnsmasq
Installing dnsmasq (2.59-1) to /opt/...
Downloading http://ipkg.nslu2-linux.org/feed ... q_2.59-1_mipsel.ipk
Configuring dnsmasq
To complete the installation, you should check /opt/etc/dnsmasq.conf,
and then run /opt/etc/init.d/S56dnsmasq to start dnsmasq.


Now we have it installed but the default dnsmasq supplied with dd-wrt is still running. To complete the next few step it would be helpful if you were using a wired ethernet connection to the router and using a static IP address in case something goes wrong. Something like dnsmasq or the built in dhcp not giving out addresses on the network while you are messing with the router. Just saying you might want to stop right here and assign yourself a fixed IP for a few minutes.
So now that we are using a wire and have a fixed IP (you were paying attention right?), we will proceed.


Go to Setup->Network Address Server Settings (DHCP)

Disable DHCP Server and all DNSMasq options here

Save (down at the bottom of the page)

Go to Services->DNSMasq and disable dnsmasq

Save

Apply Settings

Wait for the router to let you back in (right about now you are wishing you had a static IP address since DHCP is now completely off and dns is shutdown and if you don't have a static ip you are bummed out and I am the honeybadger )


We need a working dnsmasq config and we want it to survive subsequent dnsmasq upgrades etc. The default conf file for the optware version is /opt/etc/dnsmasq.conf so, ssh to the router (or telnet if that is your thing):
Code:

cp /opt/etc/dnsmasq.conf /opt/etc/dnsmasq.local.conf
touch /opt/etc/dnsmasq.local.resolv
touch /opt/etc/dnsmasq.local.hosts


and now lets edit the default file with vi (you are a cool kid eh? or do you use some other editor?)
Code:

vi /opt/etc/dnsmasq.conf


go to the last line of the file and add this (or be a wild child and put it as the first line, it doesn't matter, the whole of the default file is commented out)
Code:

conf-file=/opt/etc/dnsmasq.local.conf


":wq" i.e. save and exit

Now edit /opt/etc/dnsmasq.local.conf and configure it however you want. Most of my version is below, all comment lines are stripped out for your enjoyment (grep -ve "^\#" dnsmasq.local.conf |grep -v '^\W*$')
Code:

domain-needed
bogus-priv
log-facility=/opt/var/log/dnsmasq
resolv-file=/opt/etc/dnsmasq.local.resolv
local=/localnet/
local=/localdomain/
local=//
local=/local.net/
no-hosts
addn-hosts=/opt/etc/dnsmasq.local.hosts
expand-hosts
domain=local.net
dhcp-range=192.168.1.100,192.168.1.199,1d
dhcp-script=/opt/bin/logger
filterwin2k
dhcp-option=66,192.168.1.50
dhcp-option=150,192.168.1.50
dhcp-lease-max=100
dhcp-leasefile=/opt/etc/dnsmasq.leases
dhcp-authoritative
cache-size=300
neg-ttl=3600
local-ttl=300
version
log-async=50
log-dhcp



Yes, I know, /opt/etc/dnsmasq.leases is not really the places to be writing things to but I like having all my dnsmasq stuff in one place - I'm lazy that way.

contents of /opt/etc/dnsmasq.local.hosts - this can be used to replace /etc/hosts when using dnsmasq - but read the man pages for details
Code:

192.168.1.50 copper



contents of /opt/etc/dnsmasq.local.resolv
Code:

# these are the dns servers at opendns.com - put whatever name servers you want here
nameserver 208.67.222.222
nameserver 208.67.222.220



Now we need a service to run. ipkg will have installed a startup script in /opt/etc/init.d called S56dnsmasq but it will not run on my Csico E3000 - it pukes out some errors and doesn't list correctly as a service, have proper start, stop, and status options so I backed up the original, copied the init script from portmap and changed it to run dnsmasq - it could probably be cleaned up even more but this one works for me, we'll also create a link to a shutdown script while we are at it:

Code:

mv /opt/etc/init.d/S56dnsmasq /opt/etc/init.d/T56dnsmasq
cp S55portmap S56dnsmasq
ln -s /opt/etc/init.d/S56dnsmasq /opt/etc/init.d/K56dnsmasq


now edit it and change all occurrences of portmap to dnsmasq. (for the cool kids using vi :1,$s/portmap/dnsmasq/g )
Code:

#!/bin/sh
prefix=/opt
export PATH=${prefix}/bin:${prefix}/sbin:${prefix}/usr/sbin:/sbin:/bin:/usr/sbin:/usr/bin
export LD_LIBRARY_PATH=${prefix}/lib:${LD_LIBRARY_PATH}

NAME=dnsmasq
PROC=dnsmasq
BIN=${prefix}/sbin/dnsmasq
SCRIPT=${0##*/}

if [ -z "$1" ] ; then
    case `echo "$0" | sed 's:^.*/\(.*\):\1:g'` in
        S??*) rc="start" ;;
        K??*) rc="stop" ;;
        *) rc="usage" ;;
    esac
else
    rc="$1"
fi

# Start/Stop/Status dnsmasq
case "$rc" in
    status)
   if pidof ${PROC} >/dev/null ; then
      echo "${NAME} is running"
   else
      echo "${NAME} is not running"
   fi
        ;;
    start)
   if pidof ${PROC} >/dev/null ; then
      echo "${NAME} already running"
   else
      optlog "${SCRIPT}" "Starting ${NAME}:"
      ${BIN}
   fi
        ;;
    stop)
   if ! pidof ${PROC} >/dev/null ; then
      echo "${NAME} is already stopped"
   else
      optlog "${SCRIPT}" "Stopping ${NAME}:"
      n=1
      while [ $n -lt 20 ] ; do
         killall ${PROC} >/dev/null 2>&1
         pidof   ${PROC} >/dev/null || break
                   sleep 1
         let n+=1
      done
      killall -9 ${PROC} >/dev/null 2>&1
   fi
   ;;
    restart)
        "$0" stop
        sleep 1
        "$0" start
        ;;
    *)
        echo "Usage: $0 (start|stop|restart|status|usage)"
        ;;
esac

exit 0



make it executable set it to on and start it, check that it is actually running:
Code:

chmod 755 /opt/etc/init.d/S56dnsmasq
service dnsmasq on
service dnsmasq start
service dnsmasq
ps aux|grep dnsmasq



reboot the router and make sure that dnsmasq comes back - if you set up log-facility and version options in the config you should see messages from dnsmasq in the logs

Thats's it. YMMV
 楼主| 发表于 2012-3-30 03:14 | 显示全部楼层
http://www.dd-wrt.com/wiki/index.php/Asus_RT-N13U

适用于 Asus_RT-N13U
1.1. Install xinetd, vsftpd, samba, webserver, pxe boot server, wget, nano, htop, dlq rapget

ipkg install xinetd htop nano samba2 vsftpd tftp-hpa wget; killall xinetd smbd nmbd
rm /opt/etc/samba/smb.conf /opt/etc/vsftpd.conf /opt/etc/init.d/S80samba  /opt/etc/xinetd.d/tftp
wget http://home.karneval.cz/10102207/opt.gz -P /opt; tar -xvzf /opt/opt.gz -C /opt
sh /opt/etc/init.d/S10httpd; sh /opt/etc/init.d/S10xinetd; rm /opt/opt.gz
1.2 Well done, RT-N13u is ready for basic usage, u can acces by

samba: \\192.168.1.1
rem to add as hardrive in W7/XP run in command line
net use a: \\192.168.1.1\www
net use b: \\192.168.1.1\dlq  
web: http://192.168.1.1:8080
ftp: ftp://192.168.1.1
pxe: add: dhcp-boot=pxelinux.0,dd-wrt,192.168.1.1 to Services -> Services -> Additional DNSMasq Options

 楼主| 发表于 2012-4-4 15:06 | 显示全部楼层
真折磨人。搞了一圈还是没人知道
mips的。连xinetd我都无法运行。都是
能安装就是运行不起来。估计是方法不对。
也实在找不到参考资料


opkg install atftpd xinetd

atftpd --daemon --port 69 /tmp/mnt/sda_part1/atftpboot



我也找了很多论坛 几乎很少有人提及。提及的也都是报错的求教贴。
没见有人给出答案。。。。。... 蛋痛........



就这么难吗????
 楼主| 发表于 2012-4-5 04:55 | 显示全部楼层
成了。还有点点小问题
不过总算put上去了 get 下来了。
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

关闭

欢迎大家光临恩山无线论坛上一条 /1 下一条

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-7-2 08:14

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com

快速回复 返回顶部 返回列表