Apache/2.4.7 (Ubuntu) Linux sman1baleendah 3.13.0-24-generic #46-Ubuntu SMP Thu Apr 10 19:11:08 UTC 2014 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) safemode : OFF MySQL: ON | Perl: ON | cURL: OFF | WGet: ON > / etc / | server ip : 172.67.156.115 your ip : 172.69.130.140 H O M E |
Filename | /etc/rc.local |
Size | 911 |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 27-Apr-2025 10:50 |
Last modified | 27-Apr-2025 10:50 |
Last accessed | 05-Jul-2025 11:25 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo "1" > /proc/sys/net/ipv4/ip_forward
ifconfig p3p1 103.30.84.18/26
ifconfig p5p1 192.168.100.251/24
#route add default gw 192.168.100.1
route add default gw 103.30.84.17
echo "nameserver 8.8.8.8" > /etc//resolv.conf
echo "nameserver 8.8.4.4" > /etc//resolv.conf
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -j MASQUERADE
/sbin/iptables -t nat -A PREROUTING -i p5p1 -p tcp -d 103.30.84.20 --dport 80 -j DNAT --to 192.168.100.251:80
/sbin/iptables -t nat -A PREROUTING -i p5p1 -p tcp -d 103.30.84.20 --dport 443 -j DNAT --to 192.168.100.251:443
exit 0
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
#
# By default this script does nothing.
echo "1" > /proc/sys/net/ipv4/ip_forward
ifconfig p3p1 103.30.84.18/26
ifconfig p5p1 192.168.100.251/24
#route add default gw 192.168.100.1
route add default gw 103.30.84.17
echo "nameserver 8.8.8.8" > /etc//resolv.conf
echo "nameserver 8.8.4.4" > /etc//resolv.conf
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -t nat -A POSTROUTING -s 192.168.100.0/24 -j MASQUERADE
/sbin/iptables -t nat -A PREROUTING -i p5p1 -p tcp -d 103.30.84.20 --dport 80 -j DNAT --to 192.168.100.251:80
/sbin/iptables -t nat -A PREROUTING -i p5p1 -p tcp -d 103.30.84.20 --dport 443 -j DNAT --to 192.168.100.251:443
exit 0