Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #
- # Orange Pi TOR ethernet router, also works with Raspberry Pi
- # Requires a usb to ethernet adapter as shown here
- # https://www.bitchute.com/video/jTVLs2mDaTWS/
- #
- # https://www.bitchute.com/channel/mechatroniac/
- #
- # If you find this useful please deposit half your life's savings to this Monero account:
- #
- # 44HwLi3kBw5DkF32D6DjjQ64W3uqqLT5dYjpQr4vHuZMX7zPYnwLeFbBrB46zL9E21NTQSeNa93B9dSLR9EpwXKdCvK2JBV
- #
- # modified from https://github.com/arpitjindal97/raspbian-recipes/blob/master/wifi-to-eth-route.sh
- #
- #
- #
- # This script is created to work with Raspbian Stretch
- # but it can be used with most of the distributions
- # by making few changes.
- #
- # Make sure you have already installed `dnsmasq`
- # Please modify the variables according to your need
- # Don't forget to change the name of network interface
- # Check them with `ifconfig`
- #hide our mac addresses(optional)
- sudo ifconfig enx00e04c534458 down
- sudo macchanger -r enx00e04c534458
- sudo ifconfig enx00e04c534458 up
- sudo ifconfig eth0 down
- sudo macchanger -r eth0
- sudo ifconfig eth0 up
- ip_address="192.168.2.1"
- netmask="255.255.255.0"
- dhcp_range_start="192.168.2.2"
- dhcp_range_end="192.168.2.100"
- dhcp_time="12h"
- eth="eth0"
- #eth1="eth1"
- #replace enx00e04c534458 with your 2nd interface, find it with 'sudo ifconfig'
- eth1="enx00e04c534458"
- sudo systemctl start network-online.target &> /dev/null
- sudo iptables -F
- sudo iptables -t nat -F
- #TOR routing, comment the following two lines out with #'s to disable TOR
- sudo iptables -t nat -A PREROUTING -i $eth -p udp --dport 53 -j REDIRECT --to-ports 53
- sudo iptables -t nat -A PREROUTING -i $eth -p tcp --syn -j REDIRECT --to-ports 9040
- sudo iptables -t nat -A POSTROUTING -o $eth1 -j MASQUERADE
- sudo iptables -A FORWARD -i $eth1 -o $eth -m state --state RELATED,ESTABLISHED -j ACCEPT
- sudo iptables -A FORWARD -i $eth -o $eth1 -j ACCEPT
- sudo iptables -A INPUT -i $eth -p tcp -m tcp --dport 22 -m start --start NEW -j ACCEPT
- sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
- sudo ifconfig $eth $ip_address netmask $netmask
- # Remove default route created by dhcpcd
- sudo ip route del 0/0 dev $eth &> /dev/null
- sudo systemctl stop dnsmasq
- sudo rm -rf /etc/dnsmasq.d/* &> /dev/null
- echo -e "interface=$eth\n\
- bind-interfaces\n\
- #put in your DNS server below if this doesn't work or if you don't know one you can use 1.1.1.1 or 8.8.8.8
- server=176.103.130.130\n\
- server=45.33.97.5\n\
- #server=1.1.1.1\n\
- domain-needed\n\
- bogus-priv\n\
- dhcp-range=$dhcp_range_start,$dhcp_range_end,$dhcp_time" > /tmp/custom-dnsmasq.conf
- sudo cp /tmp/custom-dnsmasq.conf /etc/dnsmasq.d/custom-dnsmasq.conf
- sudo systemctl start dnsmasq
- sudo service tor start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement