# sysctl net.ipv4.ip_forward
net.ipv4.ip_forward = 0
If sysctl net.ipv4.ip_forward is set to 0, then routing is not activated. Activate routing with the following command:
# sysctl -w net.ipv4.ip_forward=1
net.ipv4.ip_forward = 1
# echo "net.ipv4.ip_forward=1" >> /etc/sysctl.conf
Next create the following script to activate routing and masquerading from your ppp0 device to your eth0 device:
# vi /usr/local/sbin/routing.sh
#!/bin/bash
ppp_dev="ppp0"
net_dev="eth0"
iptables -t nat -A POSTROUTING -o $net_dev -j MASQUERADE
iptables -A FORWARD -i $net_dev -o $ppp_dev -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i $ppp_dev -o $net_dev -j ACCEPT
Make it executable:
# chmod 755 /usr/local/sbin/routing.sh
And execute it:
# /usr/local/sbin/routing.sh
Before you can really connect to the internet now, you have to modify the prior created named.conf and enter some external nameserver to forward queries. Just add the following lines in the named.conf file in the options section:
# vi /etc/bind/named.conf
options {
...
allow-query { any; };
forwarders {
9.9.9.9;
8.8.8.8;
};
};
And restart bind:
# systemctl restart bind9
When you establish a line between your Dreamcast and your Dreamcast server now, you can surf the web with your Dreamcast again. And this is how Google looks in 2020 on your Dreamcast:
No comments:
Post a Comment