This shows you the differences between two versions of the page.
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-18 17:49] omolini [ppp.sh] |
||
---|---|---|---|
Line 318: | 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 323: | 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 329: | Line 343: | ||
# | # | ||
# Default: lcpidle=5 | # Default: lcpidle=5 | ||
- | # | ||
lcpidle=5 | lcpidle=5 | ||
Line 350: | Line 363: | ||
# 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. |