That certainly works without problems if you don't have as a requirement
the use of a 44 src address on the public internet (and the BGP
announces subnets if there is no need to preserve the 44 address).
For this, on you gateway you need to set up the IPIP tunnels as usual
EXCEPT adding a default route via the gw and do NAT on you WAN (the
usual setup).
Use your 44 subnet as the DHCP pool.
IPIP connected networks will be reachable via the tunnels using the 44
addresses, incoming connections from the tunnels are also possible, and
all non-ampr traffic will go via the default WAN using its public IP.
If you need access from the public internet to your local 44's, you need
to register the specific devices in the ampr DNS and set up some policy
routing to return the traffic coming via the GW back to the GW by
marking the connections and routing them back. This is done depending on
what gateway you use.
E.g. on Linux you can use a separate routing tables, say 44 for ampr and
45 for internet replies (interface in the example is called tun44,
$MY_IP is your gw IP an is detected by the script), to achieve this.
Make sure your firewall rules allow forwarding between the tunnel
interface and the ones you want to be accessible from the tunnels and
the internet...
#!/bin/sh
MY_IP=`ip addr list dev tun44 | grep -w "inet" | awk '{print $2}'`
# wait for tunnel interface
while [ "$MY_IP" == "" ]; do
sleep 1
MY_IP=`ip addr list dev tun44 | grep -w "inet" | awk '{print $2}'`
done
# AMPR routes go to table 44
#
ip rule add from $MY_IP table 44
ip rule add to 44.0.0.0/9 table 44
ip rule add to 44.128.0.0/10 table 44
# default AMPR routes for BGP announced hosts - comment to access
directly via GW IP
#
ip route add 44.0.0.0/9 via 169.228.34.84 dev tun44 onlink
ip route add 44.128.0.0/10 via 169.228.34.84 dev tun44 onlink
# default AMPR reply route is in table 45
#
ip route add default via 169.228.34.84 dev tun44 table 45 onlink
# mark incoming and route replies via table 45
#
ip rule add fwmark 45 table 45
iptables -t mangle -A PREROUTING -i tun44 -s 44.0.0.0/9 -j RETURN
iptables -t mangle -A PREROUTING -i tun44 -s 44.128.0.0/10 -j RETURN
iptables -t mangle -A PREROUTING -i tun44 -j CONNMARK --set-mark 45
iptables -t mangle -A PREROUTING ! -i tun44 -m connmark --mark 45 -j
CONNMARK --restore-mark
iptables -t mangle -A OUTPUT -m connmark --mark 45 -j CONNMARK
--restore-mark
# start ampr-ripd (add your -a parameter if needed)
ampr-ripd -s -t 44 -i tun44 -m 90
Marius, YO2LOJ
On 08/01/2023 11:14, kj7omo--- via 44net wrote:
Hey y'all! I wanna set up a DHCP server on my
gateway to hand my 44.x.x.x IPs to my various ham radio devices and provide them with
internet access, as well as direct access to the outside world, allowing them to be
accessed remotely via the 44.x.x.x IPs, is this possible?
_______________________________________________
44net mailing list -- 44net(a)mailman.ampr.org
To unsubscribe send an email to 44net-leave(a)mailman.ampr.org