I have ordered an additional IP address which I can use via a GRE tunnel. My plan ist to tunnel only specific devices through this tunnel so that they reach out to servers on the internet via this IP address and are rechable through this IP adress. For example a VM or another device on my network.
I would suggest to set the tunnel3 to have its own routing table and then play a bit with policy based routing.
Something like this should work.
This sets the tunnel3 to use the routing table 100 (you can chose anything in between 2 and 252) and you can even have the default route in this table.
You can verify this by issuing ip route show table 100 to see the content of this table.
With this, all traffic with source 192.168.100.100 will perform the lookup in the table 100 and not in the default table.
Verify this by issuing the ip rule show, you should get something like this.
root@staging-gw-prg:~# ip rule show
0: from all lookup local
1: from 192.168.100.100 lookup 100
32766: from all lookup main
32767: from all lookup default
You need to play a bit with this to get the results you want. In case you need to troubleshoot the traffic, tcpdump is your friend.
Did what you suggested, but it looks a bit different as your output:
root@omnia:~# ip route show table 100
5.230.x.x dev gre4-tunnel1 proto static scope link
root@omnia:~# ip rule show
0: from all lookup local
1: from all lookup 100
10000: from 5.230.x.xlookup 100
20000: from all to 5.230.x.x lookup 100
32766: from all lookup main
32767: from all lookup default
90045: from all iif lo lookup 100
Yes, you do not have the default route in the table 100.
Try to add the defaut route to the table 100 by typing ip ro add default via 172.16.x.x table 100.
Remove the policy rule 1 (I hope this will work ip rule del pref 1) and add ip rule add pref 1 from 192.168.100.100/32 table 100 and test it again.
DO NOT USE the route command as it is broken for last 20 years. Learn to use iproute.