steptail.com

Does expecting the unexpected make the unexpected the expected?

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:10]
omolini
guides:virtual_modem:script [2020-02-27 22:47]
omolini [vmodem.sh]
Line 18: Line 18:
 # -------------------------------- # --------------------------------
 # Oliver Molini 2019 # Oliver Molini 2019
 +#
 +# Billy Stoughton II for bug fixes and contributions
 # #
 # Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License # Licensed under Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International Public License
 # https://​creativecommons.org/​licenses/​by-nc-sa/​4.0/​ # https://​creativecommons.org/​licenses/​by-nc-sa/​4.0/​
-#+
 # Tested working out of box with the following host configurations:​ # Tested working out of box with the following host configurations:​
 # #
Line 318: Line 320:
 #!/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 323: Line 332:
 # - 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 329: Line 345:
 # #
 # Default: ​   lcpidle=5 # Default: ​   lcpidle=5
-# 
 lcpidle=5 lcpidle=5
  
Line 350: Line 365:
  
 # 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.
Line 383: Line 398:
 echo "Thank you for visiting! Bye!" echo "Thank you for visiting! Bye!"
 sleep 2 sleep 2
 +</​code>​
 +
 +===== 3.sh =====
 +This example script allows VT100 compatible terminal access to the web by way of running lynx as soon as the number "​3"​ is dialed with "​ATD3"​. It demonstrates how to add a Linux based web browser for simple terminals.
 +
 +<code bash 3.sh>
 +#!/bin/bash
 +#
 +export TERM=vt100
 +echo "​Terminal type set to $TERM. Running Lynx ..."
 +lynx
 </​code>​ </​code>​
  
guides/virtual_modem/script.txt · Last modified: 2022-12-28 03:32 by omolini