Last active
November 30, 2023 22:08
-
-
Save mkopa/d8823ab80c6a7bd07b9d93edff0f34ac to your computer and use it in GitHub Desktop.
PPP over Serial Port
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| On client: | |
| 1. | |
| add: | |
| nameserver 8.8.8.8 | |
| nameserver 1.1.1.1 | |
| to /etc/resolv.conf | |
| 2. | |
| sudo stty -F /dev/ttyUSB0 raw | |
| sudo stty -F /dev/ttyUSB0 -a | |
| sudo pppd -detach /dev/ttyUSB0 19200 10.0.5.2:10.0.5.1 noauth local debug dump defaultroute nocrtscts persist maxfail 0 holdoff 1 | |
| // raspberry pi disable wifi: $ sudo rfkill block wifi && sudo ip link set wlan0 down | |
| sudo vim /etc/rc.local | |
| echo "Starting pppd..." | |
| sudo stty -F /dev/ttyUSB0 raw | |
| sudo stty -F /dev/ttyUSB0 -a | |
| sudo pppd -detach /dev/ttyUSB0 19200 10.0.5.2:10.0.5.1 noauth local debug dump defaultroute nocrtscts persist maxfail 0 holdoff 1 | |
| On Host: | |
| sudo sysctl -w net.ipv4.ip_forward=1 | |
| sudo ip addr add 10.0.5.1/24 dev enp4s0 | |
| sudo iptables -A FORWARD -o enp4s0 -i ppp0 -s 10.0.5.0/24 -m conntrack --ctstate NEW -j ACCEPT | |
| sudo iptables -A FORWARD -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT | |
| sudo iptables -t nat -F POSTROUTING | |
| sudo iptables -t nat -A POSTROUTING -o enp4s0 -j MASQUERADE | |
| sudo stty -F /dev/ttyUSB0 raw | |
| sudo pppd /dev/ttyUSB0 19200 10.0.5.1:10.0.5.2 proxyarp local noauth debug nodetach dump nocrtscts passive persist maxfail 0 holdoff 1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment