Penguin

NathanWard is considering selling public IP addresses over the MetaNet. See NathanWard for details about that.

Several MetaNet users have public IP addresses routed to thier homes over the MetaNet, incl GavinGrieve and PerryLorier (I think), and now NathanWard.

This is how I've done my routing:

      Internet ------- My public router (it has 202.6.75.0/24 to it at present)
         |                    || 192.168.230.192
         |                    ||
     ADSL line                ||
       A |                    ||
         |      B             //
         |----- linux box ====/
         |                192.168.230.255
        PCs 202.6.75.211-222
            10.230.255.10-250

===  and  ||   MetaNet
---  and  |    'Normal' network
  • The linux box has 1 NIC in it, but really, 2 would be nicer.
  • Interface A has 10.230.255.1/24 and 202.6.75.209/24.
  • Interface B has 10.230.255.254/24.
  • The default route on the linux box points at 10.230.255.254.

Now, you need to do this:

echo -e "1\tpublic_to_world" >> /etc/iproute2/rt_tables
ip route add 0.0.0.0/0 via 192.168.230.192 dev wan0 table public_to_world
ip rule add from 202.6.75.208/28 to 192.168.0.0/16 pref 3000 lookup main
ip rule add from 202.6.75.208/28 to 10.0.0.0/8 pref 4000 lookup main
ip rule add from 202.6.75.208/28 to 202.6.75.208/28 pref 5000 lookup main
ip rule add from 202.6.75.208/28 to 0.0.0.0/0 pref 6000 lookup public_to_world

On some ISP's you don't need to be so complicated, turn off rp_filter, and just send them out your default gateway. Orcon for instance allow this.