jiggi Posted May 9, 2019 Share Posted May 9, 2019 Hi all, I'm trying to spoof dns in a static network based on the original script. So far, I've spent hours on it without any results - and I don't know why... From my understanding, I would have to do it as such: Let's say I have a network in 192.168.1.0/24 with one router in 192.168.1.1 and my host is 192.168.1.50. 1) set a static IP on eth0 which mimics the router (example: 192.168.1.1) --> uci set network.lan.ipaddr="192.168.1.1" 2) set a static IP on eth1 which mimics my host on the network (example: 192.168.1.50) --> uci set network.wan.ipaddr="192.168.1.50" And then let the script do it's own stuff with the dnsmasq address and the iptables. The whole script would look like this: #!/bin/bash function setup(){ uci set network.lan.ipaddr="192.168.1.1" uci set network.wan.ipaddr="192.168.1.50" sleep 5 cp $(dirname ${BASH_SOURCE[0]})/spoofhost /tmp/dnsmasq.address &> /dev/null /etc/init.d/dnsmasq restart } function run(){ iptables -A PREROUTING -t nat -i eth0 -p udp --dport 53 -j REDIRECT --to-port 53 } setup run Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.