Hello,
I’ve installed a test CHR on VPS-server.
Somehow I’m unable to get internet connection.
VPS hoster provided following settings:
IP-address:109...*
Gateway: 10.0.0.1
Netmask: 255.255.255.255
There’s only ether1 which is connected to outer world.
These are settings I’ve applied:
ip address add address=109.*.*.* netmask=255.255.255.255 interface=ether1 network=109.*.*.* disabled=no
ip firewall nat add chain=srcnat action=masquerade
ip dns set servers=8.8.8.8
ip route add dst-address=0.0.0.0/0 gateway=ether1
ip route add dst-address=10.0.0.1 gateway=ether1
default gateway (10.0.0.1) is pinging ok, however 8.8.8.8 is not pinging at all.
if I add
ip route add dst-address=0.0.0.0/0 gateway=10.0.0.1
Basically it means 10.0.0.1 on interface ether1, or 10.0.0.1 reachable through interface ether1.
There are two “modifiers” for gateway addresses: https://wiki.mikrotik.com/wiki/Manual:IP/Route
gateway (IP | interface | IP%interface | IP@table[, IP | string, [..]]; Default: “”) Array of IP addresses or interface names. Specifies which host or interface packets should be sent to. Connected routes and routes with blackhole, unreachable or prohibit type do not have this property. Usually value of this property is a single IP address of a gateway that can be directly reached through one of router’s interfaces (but see nexthop lookup). ECMP routes have more than one gateway value. Value can be repeated several times.
% means “at” when referred to interface
@ means “at” when referred to routing table or VRF
Some more thoughts on the setup.
There was an ubuntu installed on this VPS and it was working just ok.
These settings were as follows:
~root@639930:~# ip address show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group defaul
t qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: ens3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP grou
p default qlen 1000
link/ether 52:54:*:*:*:* brd ff:ff:ff:ff:ff:ff
inet 109.*.*.*/32 brd 109.*.*.* scope global ens3
valid_lft forever preferred_lft forever
inet6 fe80::*:*:*:*/64 scope link
valid_lft forever preferred_lft forever
ip route show
default via 10.0.0.1 dev ens3 onlink
Why is that route distance 2?
It should not matter since you have no other routes for 0.0.0.0/0, still it should normally have distance 1.
You should probably specify out-interface=ether1 in your /ip firewall nat masquerade rule. but that is also - I believe - not relevant.
Your connection/route to 10.0.0.1/32 became ADC, the A is active (as before) but it is not anymore static, it is DC (Dynamic and Connected) and has a distance of 0 which means that the router automatically added it, and this AFAIK only happens if the DST-ADDRESS is in the same subnet as the IP address of the connected interface or however it knows somehow where to find it, I am guessing that the