3

I am trying to route an IP address (camera sensor) to an edge server through a 5G network. The camera sensor is connected to a 5G Modem. The camera IP address is 10.45.3.1, the 5G link IP address is 192.168.2.1, and the edge sever IP address is 10.44.2.2.

I am using Linux machines on all equipments.

So far I was able to add the camera IP address to the 5G link IP address and I am able to send the camera packets to the 5G Base Station. Now how can I route the camera IP address to the Edge server from the 5G Base Station? What iptables rules and chains should I use on the 5G Base Station to direct camera packets to 10.44.2.2, and on the Edge Server to accept those packets?

so Far on the UE I have:

#Forward every packet that comes to wwp0s20u3i5 to DATA1
iptables -A FORWARD -i wwp0s20u3i5 -o DATA1 -j ACCEPT

#DNAT to forward packets to camera
iptables -t nat -A PREROUTING -d 192.168.2.2 -j DNAT --to-destination 10.45.3.1

And on the 5G Base Station I have:

# Add routes to the camera via tun0
ip route add 10.45.3.1 via 192.168.2.1

iptables -A FORWARD -i CTRL -o tun0 -j ACCEPT

#NAT for forwarding packets
#Forward packets to different ports of the UE (srv1-in1)
iptables -t nat -A OUTPUT -d 10.45.3.1 -j DNAT --to-destination 192.168.2.2

Now how can I forward the 10.45.3.1 from the 5G Base Station to the Edge Server?

Thanks in advance

1 Answer 1

3

On the 5G Base Station you can add iptables rules:

Enable IP forwarding: echo 1 > /proc/sys/net/ipv4/ip_forward

Set up the NAT rule to forward packets from the camera IP address (10.45.3.1) to the Edge Server (10.44.2.2): iptables -t nat -A PREROUTING -d 10.45.3.1 -j DNAT --to-destination 10.44.2.2

Allow forwarding of the packets: iptables -A FORWARD -p all -s 10.45.3.1 -j ACCEPT

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .