steptail.com

If I try to fail, but succeed, which one did I do?

User Tools

Site Tools


guides:virtual_modem:script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
guides:virtual_modem:script [2019-11-19 00:04]
omolini
guides:virtual_modem:script [2020-02-18 17:48]
omolini [ppp.sh]
Line 82: Line 82:
  
 # Variable: resultverbose # Variable: resultverbose
-# Controls default ​behaviour ​when printing result +# Controls default ​behavior ​when printing ​Hayes result 
-# codes. When 0, will print result codes in numerical +# codes. ​ 
-form. When 1, will print result codes in english.+When 0, prints ​result codes in numerical form. (eg. 0) 
 +When 1, prints ​result codes in english. ​(eg. CONNECT)
 # Default is 1. # Default is 1.
 resultverbose=1 resultverbose=1
Line 147: Line 148:
  
     #     #
-    # --- MODEM EMULATION ---+    # --- HAYES EMULATION ---
     #     #
     if [[ $cmd == AT* ]]; then     if [[ $cmd == AT* ]]; then
Line 317: Line 318:
 #!/bin/bash #!/bin/bash
 # RUN PPPD DAEMON # RUN PPPD DAEMON
 +#
 +# Oliver Molini 2019
 +
 +# Billy Stoughton II for bug fixes and contributions
 +#
 +# Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
 +# https://​creativecommons.org/​licenses/​by-nc-sa/​4.0/​
 # #
 # Note on PPPD settings: # Note on PPPD settings:
Line 322: Line 330:
 # - Make sure DNS servers are defined (add ms-dns 1.2.3.4 twice) # - Make sure DNS servers are defined (add ms-dns 1.2.3.4 twice)
 # #
 +
 +# Variable: etherp
 +# Specify the ethernet device to use to connect to your network.
 +
 +# Default: ​   etherp=eth0
 +etherp=eth0
 +
 # Variable: lcpidle # Variable: lcpidle
 # Specifies the idle timeout period in seconds for lcp-echo-interval. # Specifies the idle timeout period in seconds for lcp-echo-interval.
Line 349: Line 364:
  
 # Share eth0 over ppp0 # Share eth0 over ppp0
-iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE +iptables -t nat -A POSTROUTING -o $etherp ​-j MASQUERADE 
-iptables -t filter -A FORWARD -i ppp0 -o eth0 -m state --state RELATED,​ESTABLISHED -j ACCEPT +iptables -t filter -A FORWARD -i ppp0 -o $etherp ​-m state --state RELATED,​ESTABLISHED -j ACCEPT 
-iptables -t filter -A FORWARD -i eth0 -o ppp0 -j ACCEPT+iptables -t filter -A FORWARD -i $etherp ​-o ppp0 -j ACCEPT
  
 # Run PPP daemon and establish a link. # Run PPP daemon and establish a link.
guides/virtual_modem/script.txt · Last modified: 2022-12-28 03:32 by omolini