Hi all,
I have been fighting with this for a good 10 hours or so now and I would appreciate some help.
I want to route between two subnets but since the Pi only has a single NIC, I have created a subinterface and have the following IP addresses set using ifconfig:
Eth0:0 - 192.168.10.1 /24 (same range as my DSL router, which is on 192.168.10.2 /24)
Eth0: 10.0.0.177 /24 (this is the default GW for my client PCs)
1) I have create a static route on my DSL router that makes traffic destined for the 10.0.0.0 /24 range, next hop through 192.168.10.1 (for when the traffic comes back)
2) I have added a default route (on the Rpi) as follows "sudo route add default gw 192.168.10.2"
3) I have added the following IPtables rules (I am almost certain they are needed, they were when this project was running ubuntu on a pcduino):
sudo iptables --table nat --append POSTROUTING --out-interface eth0:0 -j MASQUERADE
sudo iptables --append FORWARD --in-interface eth0 -j ACCEPT
4) I have disabled ICMP redirects, ipv6 and made sure that ip_forwarding is set to 1 (on) by putting the following into /opt/bootsync.sh.
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/default/accept_redirects"
sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/all/accept_redirects"
sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/eth0/accept_redirects"
sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/default/send_redirects"
sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/all/send_redirects"
sudo sh -c "echo 0 > /proc/sys/net/ipv4/conf/eth0/send_redirects"
sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/default/disable_ipv6"
sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/all/disable_ipv6"
sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/eth0/disable_ipv6"
sudo sh -c "echo 1 > /proc/sys/net/ipv6/conf/lo/disable_ipv6"
The reason why i have done this is because I cannot find the /etc/sysctl.conf and while this isnt a biggie (since I just echo'd it as shown above), this might actually be the reason why it is not working because if the original config is loaded into the kernel (e.g. send_redirects = 1) and then it is changed to 0 afterwards (send_redirects = 0), it won't actually do anything (unless I reboot or reload the sysctl (used to use "sysctl -p" on ubuntu). If I reboot, I am back to square one so maybe this is the issue. I tried to solve this by putting the following into the /opt/.filetool.lst but it didn't seem to do anything (i.e. I saved that, echo'd all the new config, rebooted and then everything was back to what it was before)
proc/sys/net/ipv4/ip_forward
proc/sys/net/ipv4/conf/default/accept_redirects
proc/sys/net/ipv4/conf/all/accept_redirects
proc/sys/net/ipv4/conf/eth0/accept_redirects
proc/sys/net/ipv4/conf/default/send_redirects
proc/sys/net/ipv4/conf/all/send_redirects
proc/sys/net/ipv4/conf/eth0/send_redirects
proc/sys/net/ipv6/conf/default/disable_ipv6
proc/sys/net/ipv6/conf/all/disable_ipv6
proc/sys/net/ipv6/conf/eth0/disable_ipv6
proc/sys/net/ipv6/conf/lo/disable_ipv6
The results are as follows:
1) If I putty into my Rpi, I can ping all local interfaces, my DSL router (192.168.10.2 /24) and any internet address
2) I can ping 192.168.10.1 and 192.168.10.2 from any desktop PC on the 10.0.0.0 /24 range
3) I CANNOT ping any internet address/
Please can someone help me, I am seriously battling here and have really tried my best to overcome this issue.
P.S: I will keep studying the tinycorelinux OS, sorry that I am not 100% with it yet. Understanding how it all works is a HIGH priority for me and I will do it properly.