Skip to content

Instantly share code, notes, and snippets.

@thekitp
Forked from billyriantono/dnsmasq.conf
Last active February 4, 2018 11:30
Show Gist options
  • Save thekitp/cf7ae97741995406a57dcaa27ed68629 to your computer and use it in GitHub Desktop.
Save thekitp/cf7ae97741995406a57dcaa27ed68629 to your computer and use it in GitHub Desktop.

Revisions

  1. thekitp revised this gist Feb 4, 2018. 3 changed files with 7 additions and 7 deletions.
    6 changes: 3 additions & 3 deletions dnsmasq.conf
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@
    interface=tap_soft
    dhcp-range=tap_soft,192.168.100.50,192.168.100.60,24h
    dhcp-option=tap_soft,3,192.168.100.1
    dhcp-option=tap_soft,option:dns-server,165.21.83.88,165.21.100.88
    dhcp-range=tap_soft,192.168.30.50,192.168.30.250,24h
    dhcp-option=tap_soft,3,192.168.30.1
    dhcp-option=tap_soft,option:dns-server,8.8.8.8,8.8.4.4
    2 changes: 1 addition & 1 deletion iptables-config
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -j SNAT --to-source [YOUR ETHERNET INTERNET IP ADDRESS]
    iptables -t nat -A POSTROUTING -s 192.168.30.0/24 -j SNAT --to-source [YOUR ETHERNET INTERNET IP ADDRESS]
    6 changes: 3 additions & 3 deletions vpnserver.sh
    Original file line number Diff line number Diff line change
    @@ -3,7 +3,7 @@
    # description: SoftEther VPN Server
    DAEMON=/usr/local/vpnserver/vpnserver
    LOCK=/var/lock/subsys/vpnserver
    TAP_ADDR=192.168.7.1
    TAP_ADDR=192.168.30.1
    TAP_ADAPTER='tap_soft'

    test -x $DAEMON || exit 0
    @@ -13,7 +13,7 @@ $DAEMON start
    touch $LOCK
    sleep 3
    sleep 1
    ifconfig $TAP_ADAPTER $TAP_ADDR
    ip addr add $TAP_ADDR/24 dev $TAP_ADAPTER
    service dnsmasq start
    ;;
    stop)
    @@ -25,7 +25,7 @@ $DAEMON stop
    sleep 3
    $DAEMON start
    sleep 1
    ifconfig $TAP_ADAPTER $TAP_ADDR
    ip addr add $TAP_ADDR/24 dev $TAP_ADAPTER
    service dnsmasq restart
    ;;
    *)
  2. billyriantono revised this gist Oct 13, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion iptables-config
    Original file line number Diff line number Diff line change
    @@ -1 +1 @@
    iptables -t nat -A POSTROUTING -s 192.168.7.0/24 -j SNAT --to-source [YOUR ETHERNET INTERNET IP ADDRESS]
    iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -j SNAT --to-source [YOUR ETHERNET INTERNET IP ADDRESS]
  3. billyriantono revised this gist Oct 13, 2014. 2 changed files with 5 additions and 4 deletions.
    5 changes: 3 additions & 2 deletions dnsmasq.conf
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,4 @@
    interface=tap_soft
    dhcp-range=tap_soft,192.168.7.50,192.168.7.60,12h
    dhcp-option=tap_soft,3,192.168.7.1
    dhcp-range=tap_soft,192.168.100.50,192.168.100.60,24h
    dhcp-option=tap_soft,3,192.168.100.1
    dhcp-option=tap_soft,option:dns-server,165.21.83.88,165.21.100.88
    4 changes: 2 additions & 2 deletions vpnserver.sh
    Original file line number Diff line number Diff line change
    @@ -12,10 +12,9 @@ start)
    $DAEMON start
    touch $LOCK
    sleep 3
    ifconfig tap_vpn 192.168.250.1
    service dhcpd restart
    sleep 1
    ifconfig $TAP_ADAPTER $TAP_ADDR
    service dnsmasq start
    ;;
    stop)
    $DAEMON stop
    @@ -27,6 +26,7 @@ sleep 3
    $DAEMON start
    sleep 1
    ifconfig $TAP_ADAPTER $TAP_ADDR
    service dnsmasq restart
    ;;
    *)
    echo "Usage: $0 {start|stop|restart}"
  4. kotekalabs revised this gist Sep 1, 2014. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions iptables-config
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    iptables -t nat -A POSTROUTING -s 192.168.7.0/24 -j SNAT --to-source [YOUR ETHERNET INTERNET IP ADDRESS]
  5. kotekalabs revised this gist Sep 1, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions dnsmasq.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,3 @@
    interface=tap_soft
    dhcp-range=tap_soft,192.168.7.50,192.168.7.60,12h
    dhcp-option=tap_soft,3,192.168.7.1
  6. kotekalabs created this gist Aug 22, 2014.
    35 changes: 35 additions & 0 deletions vpnserver.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,35 @@
    #!/bin/sh
    # chkconfig: 2345 99 01
    # description: SoftEther VPN Server
    DAEMON=/usr/local/vpnserver/vpnserver
    LOCK=/var/lock/subsys/vpnserver
    TAP_ADDR=192.168.7.1
    TAP_ADAPTER='tap_soft'

    test -x $DAEMON || exit 0
    case "$1" in
    start)
    $DAEMON start
    touch $LOCK
    sleep 3
    ifconfig tap_vpn 192.168.250.1
    service dhcpd restart
    sleep 1
    ifconfig $TAP_ADAPTER $TAP_ADDR
    ;;
    stop)
    $DAEMON stop
    rm $LOCK
    ;;
    restart)
    $DAEMON stop
    sleep 3
    $DAEMON start
    sleep 1
    ifconfig $TAP_ADAPTER $TAP_ADDR
    ;;
    *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
    esac
    exit 0