Jump to content
Not connected, Your IP: 3.233.217.242

Search the Community

Showing results for tags 'script'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • AirVPN
    • News and Announcement
    • How-To
    • Frequently asked questions
    • Databases
  • Community
    • General & Suggestions
    • Troubleshooting and Problems
    • Blocked websites warning
    • Eddie - AirVPN Client
    • Reviews
    • Other VPN competitors or features
    • Nonprofit
    • Off-Topic
  • Other Projects
    • IP Leak
    • XMPP
    • Mirrors

Product Groups

  • AirVPN Access
  • Coupons
  • Misc

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Twitter


Mastodon


AIM


MSN


ICQ


Yahoo


XMPP / Jabber


Skype


Location


Interests

Found 5 results

  1. Hi everyone, I had some difficulty setting up port forwarding with the Merlin WRT firmware on my ASUS routers and did not find a great guide online so figured I would write one up to hopefully help save someone a few hours of pain. 1. Download the Merlin WRT firmware from the website and just upload is as a regular file through the Administration -> Firmware Upgrade page. 2. Once done go to Administration -> System -> Persistent JFFS partition and make sure enable both options and restart. This is where the script will go. Restart the router. 3. Download Win-SCP to help you upload and edit files on the router. I found this to be the easiest way. 4. Log in to your router with WinSCP: - File protocol: SCP - Host name: Router IP (eg. 192.168.1.1) - User name/Password of your router – Login 5. Use the “..” folder all the way on the top to go all the way back where you will see “jffs” partition. Go to jffs -> scripts and then right click and create new file named “nat-start” without quotations. So /jffs/scripts/nat-start For whatever reason the first time I activated JFFS partition it was read only and did not allow me to create any new files so I followed the instructions here and used the commands through telnet to mount the partition and then restarted the router 6. Once the file is created, right click and goto properties and make sure Owner permission has check next to “X” making it executable. You can do this through telnet also using chmod command. 7. Use the following script below to setup port forwarding: #!/bin/sh iptables -I FORWARD -i br0 -o tun11 -j ACCEPT iptables -I FORWARD -i tun11 -o br0 -j ACCEPT iptables -I FORWARD -i br0 -o vlan1 -j DROP iptables -I INPUT -i tun11 -j REJECT iptables -t nat -A POSTROUTING -o tun11 -j MASQUERADE iptables -I FORWARD -i tun11 -p udp -d *IP of device requiring open port* --dport *Port* -j ACCEPT iptables -I FORWARD -i tun11 -p tcp -d *IP of device requiring open port* --dport *Port* -j ACCEPT iptables -t nat -I PREROUTING -i tun11 -p tcp --dport *Port* -j DNAT --to-destination *IP of device requiring open port* iptables -t nat -I PREROUTING -i tun11 -p udp --dport *Port* -j DNAT --to-destination *IP of device requiring open port* ~Obviously replace the stuff between * * with the right numbers and remove the *. 8. To check which tun and vlan you have telnet to your router and type in “ifconfig” and use this information to determine this. The 2nd paragraph can be copied for multiple ports. I have OSX so I used "Terminal.app" and typed "telnet 192.168.1.1" and then type in your admin/pass, then "ifconfig". 9. That’s it. Save it and restart your router. Make sure you obviously setup the correct ports on the AirVPN website. 10. You can check under your router page: System Log -> Port Forwarding to see the appropriate ports being forwarded. Also can check through the AirVPN website. Hope that helps. Let me know if something is unclear and I will modify it. Thanks and enjoy.
  2. cm0s

    airvpn AP script

    script put together today for those wanting a quick AP tested with iphone and 36nh wifi card i'm not a coder so mod it for your distro fixes/improvements etc #!/bin/bash # 062117 # ap script for openvpn via ssl/443 # mod for yer distro or vpn needs # i'm not a coder so double check for # any errors/improvements etc. # tested with iphone and alfa awus036nh ################################################## LG='\033[0;37m' LB='\033[1;34m' LC='\033[1;36m' BO='\033[0;33m' YL='\033[1;33m' GR='\033[0;32m' RD='\033[0;31m' NC='\033[0m' # No Color ################################################## f_exit(){ clear exit 2> /dev/null } ################################################## # ctrl+c trap f_stop 2 ################################################## f_stop(){ # virtcent=$((`tput lines`/2-5)) horcent=$((`tput cols`/2-10)) # clear f_banz && tput cup $virtcent $horcent && echo -e "\n\e[1;34m [*]\e[0m ${GR}flushen the toilet bruh...${NC}\n" sleep 1 # stop the mcluvnz if [ ! -z "$(pidof dnsmasq)" ]; then kill $(pidof dnsmasq); fi if [ ! -z "$(pidof macchanger)" ]; then kill $(pidof macchanger); fi if [ ! -z "$(pidof xterm)" ]; then kill $(pidof xterm); fi if [ ! -z "$(pidof create_ap)" ]; then kill $(pidof create_ap); fi # echo "0" > /proc/sys/net/ipv4/ip_forward # # stop apz killall -9 create_ap > /dev/null 2>&1 sleep 1 f_mainmenu } ################################################## f_tblzvpn(){ # virtcent=$((`tput lines`/2-5)) horcent=$((`tput cols`/2-10)) # clear f_banz && tput cup $virtcent $horcent && echo -e "\n\e[1;34m [*]\e[0m ${GR}IPTABLEs VPN/SSL${NC}" sleep 4 # iptables -F iptables -t nat -F iptables -t mangle -F # iptables -X iptables -t nat -X iptables -t mangle -X # iptables -P INPUT DROP iptables -P FORWARD DROP # iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT iptables -A INPUT -p tcp -m state --state NEW -m multiport --dports 80,443 -j ACCEPT # iptables -A INPUT -i lo -j ACCEPT iptables -A OUTPUT -o lo -j ACCEPT # iptables -A OUTPUT -d 255.255.255.255 -j ACCEPT iptables -A INPUT -s 255.255.255.255 -j ACCEPT iptables -A INPUT -s 192.168.0.0/16 -d 192.168.0.0/16 -j ACCEPT iptables -A OUTPUT -s 192.168.0.0/16 -d 192.168.0.0/16 -j ACCEPT iptables -A FORWARD -i eth0 -o tun0 -j ACCEPT iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT iptables -t nat -A PREROUTING -s 0/0 -p udp --dport 53 -j DNAT --to 10.5.0.1 iptables -t nat -A PREROUTING -s 0/0 -p tcp --dport 53 -j DNAT --to 10.5.0.1 iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE iptables -A OUTPUT -o eth0 ! -d 127.0.0.1 -p tcp --dport 1413 -j DROP # # ignore bad error messages for f in /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses; do echo 1 > $f done # # Disable response to broadcasts for f in /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts; do echo 1 > $f done # # disable source routed packets for f in /proc/sys/net/ipv4/conf/*/accept_source_route; do echo 0 > $f done # # enable TCP SYN cookie for f in /proc/sys/net/ipv4/tcp_syncookies; do echo 1 > $f done # # disable ICMP redirect acceptance for f in /proc/sys/net/ipv4/conf/*/accept_redirects; do echo 0 > $f done # # no redirect messages for f in /proc/sys/net/ipv4/conf/*/send_redirects; do echo 0 > $f done # # drop spoofz for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 1 > $f done # # save stuff if [ ! -e /root/tablz ]; then mkdir /root/tablz; fi iptables-save > /root/tablz/iptables.rules # f_mainmenu } ################################################## f_tblzallow(){ # virtcent=$((`tput lines`/2-5)) horcent=$((`tput cols`/2-10)) # clear f_banz && tput cup $virtcent $horcent && echo -e "\n\e[1;34m [*]\e[0m ${GR}IPTABLEs ALLOW ALL${NC}" sleep 4 # iptables -F iptables -X iptables -P INPUT ACCEPT iptables -P OUTPUT ACCEPT # f_mainmenu } ################################################## f_install(){ # virtcent=$((`tput lines`/2-5)) horcent=$((`tput cols`/2-10)) # clear f_banz && tput cup $virtcent $horcent && echo -e "\n\e[1;34m [*]\e[0m ${GR}nstallen create_ap${NC}\n" sleep 2 reqs1="create_ap" sleep 1 pacman -S --noconfirm --needed $reqs1 sleep 2 clear f_banz && tput cup $virtcent $horcent && echo -e "\n\e[1;34m [*]\e[0m ${GR}create_ap installed${NC}\n" sleep 4 # f_mainmenu } ################################################## f_makaddy(){ # virtcent=$((`tput lines`/2-5)) horcent=$((`tput cols`/2-10)) # clear unset WIFACE while [ -z "${WIFACE}" ]; do f_banz && tput cup $virtcent $horcent && read -p "$(echo -e "\n\e[1;34m [*]\e[0m ${GR}name of wifi card such as wlan0: ${NC}\n")" WIFACE; done sleep 1 # clear unset macvar f_banz && tput cup $virtcent $horcent && read -p "$(echo -e "\n\e[1;34m [*]\e[0m ${GR}wanna change yer mac addy for AP? [y/N]: ${NC}\n")" macvar mac_answer=$(echo ${macvar} | tr '[:upper:]' '[:lower:]') # sleep 1 clear unset random_mac unset ap_mac if [ "${mac_answer}" == "y" ]; then while [ -z "${random_mac}" ]; do f_banz && tput cup $virtcent $horcent && read -p "$(echo -e "\n\e[1;34m [*]\e[0m ${GR}random or manual? [r/m]: ${NC}\n")" random_mac; done case ${random_mac} in r|R) ip link set ${WIFACE} down && macchanger -r ${WIFACE} && ip link set ${WIFACE} up;; m|M) while [ -z "${ap_mac}" ]; do clear && f_banz && tput cup $virtcent $horcent && read -p "$(echo -e "\n\e[1;34m [*]\e[0m ${GR}with caps enter macaddy for AP: ${NC}\n")" ap_mac; done if [ -z $(echo ${ap_mac} | sed -n "/^\([0-9A-Z][0-9A-Z]:\)\{5\}[0-9A-Z][0-9A-Z]$/p") ]; then clear && f_banz && tput cup $virtcent $horcent && echo -e "\n\e[1;34m [*]\e[0m ${GR}nvalid macaddy bruh...${NC}\n" sleep 1 f_makaddy else ip link set ${WIFACE} down sleep 1 macchanger -m ${ap_mac} ${WIFACE} sleep 1 iplink set ${WIFACE} up fi esac fi } ################################################## f_airAP(){ # virtcent=$((`tput lines`/2-5)) horcent=$((`tput cols`/2-10)) # clear f_banz && tput cup $virtcent $horcent && echo -e "\n\e[1;34m [*]\e[0m ${GR}HIDDEN AP WPA2 STATIC DNS w/NET${NC}" sleep 4 clear f_banz && tput cup $virtcent $horcent && echo -e "\n\e[1;34m [*]\e[0m ${GR}ctrl + c to stop the AP ${NC}" sleep 4 # f_makaddy # clear unset DNSZ while [ -z "${DNSZ}" ]; do f_banz && tput cup $virtcent $horcent && read -p "$(echo -e "\n\e[1;34m [*]\e[0m ${GR}enter static dns such as 10.5.0.1: ${NC}\n")" DNSZ; done sleep 2 # clear unset IFACE while [ -z "${IFACE}" ]; do f_banz && tput cup $virtcent $horcent && read -p "$(echo -e "\n\e[1;34m [*]\e[0m ${GR}iface connected to net such as eth0/tun0: ${NC}\n")" IFACE; done sleep 2 # clear unset ESSID while [ -z "${ESSID}" ]; do f_banz && tput cup $virtcent $horcent && read -p "$(echo -e "\n\e[1;34m [*]\e[0m ${GR}enter name of AP: ${NC}\n")" ESSID; done sleep 2 # clear unset PASZ while [ -z "${PASZ}" ]; do f_banz && tput cup $virtcent $horcent && read -p "$(echo -e "\n\e[1;34m [*]\e[0m ${GR}enter wpa2 password: ${NC}\n")" PASZ; done sleep 2 create_ap -m nat --dhcp-dns ${DNSZ} ${WIFACE} ${IFACE} --hidden ${ESSID} ${PASZ} --no-virt sleep 2 f_mainmenu } ################################################## # menu stuff ################################################## f_banz(){ tput setaf 2 echo -e ' ____ _ ____ _ _ ___ _ _ ____ ___ |__| | |__/ | | |__] |\ | __ |__| |__] | | | | \ \/ | | \| | | | ' tput setaf 7 echo -e ' ======================================= ' tput sgr0 } ################################################## f_mainmenu(){ clear f_banz echo -e " ${LB}Main Menu\n" echo -e " ${RD}1. ${BO}airAP${NC}" echo -e " ${RD}2. ${BO}tablz VPN${NC}" echo -e " ${RD}3. ${BO}tablz ALLOW${NC}" echo -e " ${RD}4. ${BO}install${NC}" echo -e " ${RD}5. ${BO}exit${NC}" echo echo read -p " Choice: " mainmenuchoice case ${mainmenuchoice} in 1) unset clean; f_airAP ;; 2) unset clean; f_tblzvpn ;; 3) unset clean; f_tblzallow ;; 4) unset clean; f_install ;; 5) f_exit ;; *) f_mainmenu ;; esac } ################################################## # root shit if [ "$(id -u)" != "0" ]; then echo -e "\n\e[1;34m [*]\e[0m ${GR}roll as root bruh...\n" 1>&2 exit 1 else clean=1 f_mainmenu fi ##################################################
  3. Hi all, I encountered a rather annoying bug. I wrote a shell script that I want to execute every time the VPN tunnel is up. My test script (which does nothing more than echoing text to a test text file) works fine when I set it up under Advanced -> Events -> App Start, App End, Session Start, Session End, VPN Pre, VPN Down but not VPN Up! When I choose to run a script on VPN Up (tested with and without waiting for the script to end) the following happens: Latency tests Checking authorization Restart in 3 seconds Connecting to server Checking route (request timed out) And this goes on and on, the VPN never actually connects. I assume there is a little bug in the VPN Up event. Hopefully this can be fixed in the next version. Best regards
  4. Dear community, Hoping someone can help with this.... I am trying to setup a firewall script for my router running Tomato Firmware 1.28.0000 -121 K26ARM USB AIO-64K by SHIBBY on a Netgear R7000 Nighthawk on mostly default settings apart from the VPN Client. The script is to block all non-VPN traffic even if the connection fails and i have tried several suggestions made in the forums without success. Below is the script most people have success with (except me): iptables -I FORWARD -i br0 -o tun0 -j ACCEPT iptables -I FORWARD -i tun0 -o br0 -j ACCEPT iptables -I FORWARD -i br0 -o vlan2 -j DROP iptables -I INPUT -i tun0 -j REJECT iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE (from https://airvpn.org/topic/4287-how-to-block-all-traffic-with-dd-wrt-if-vpn-connection-fails/) I think the problem lies in the assigned interface names. Below is my current routing table while VPN'd: In short can someone modify the script to suite my arrangement?? or let me know what direction I need to take to set this up.... using the script above lets traffic through even if I stop the VPN client and my attempts to modify usually blocks all traffic. Any help would me much appreciated, EWS
  5. I'm using a 4 port RT-N16 Toastman build VPN, VLAN version router. Netgear 24port switch Linux machines 2 streaming media players, playstations I want to split the network up into 3 segments. 192.168.1.x, 192.168.2.x, 192.68.3.x *Important* - I don't want any segment on the network to be able to speak to each other. Segment 1 and 2 - I want to Tunnel through the VPN via network manager on the Linux machines using SSL Port 443. These connections have 13 ports to connect through on the switch. 0/01, 0/02, 0/03.....0/013 On 1 segment - I want to go through the VPN to America via the a Tomato router configuration using Client 1. I don't care what port I use. These connections will have 6 ports to connect through the switch. 0/14, 0/15, 0/16......0/19, 0/20 I've been at this for a 2 good solid days manipulating scripts, manual configurations through the GUI on tomato, etc. I like to figure things out myself, and I've learned alot, but i think it's time I asked for some help. Anyone have an idea how to do this? Greatly appreciate your input!
×
×
  • Create New...