Just what I needed - thanks! I'm familiar with IP itself, but I was always a bit hazy about the Unix-style routing tables. The explanation that it searches for the longest match was particularly helpful.
Excellent...I always stuck in routing.. But this is really fantastic explanation and exactly what I was looking for.appreciate if you show routing for multi.nic configured server.
Thanks a lot Steven. I've set up the same network but with "netplan" tool (I'm using Ubuntu 22.04). Now PCs from different networks see each other (ping goes fine) and next time I'll connect Kali Linux to start its tools and learn ethical hacking
It would also work if you on the server or client removed the default router and added an new to the router instead. That is the default route on the server is change from 10.0.2.2 to 192.168.2.2. It will use the router for all transmissions out on the internet from the server, instead of using the 10.0.2.2. To test routing, try the command tracepath(1) or traceroute(1) and you will see which routers will be used between the current computer and destination.
Nice video, thanks. Would be nice to see how the router itself was set up. You said it was another Linux VM? You somehow used VirtualBox to attach two network interfaces to it and manually set up the routes?
For this small network you could use 192.168.1.0/24. However I used 192.168.0.0/16 as in the future I plan to have network with three chained subnets, e.g. 192.168.1.0 connected to 192.168.2.0 connected to 192.168.3.0. Then a route on 192.168.3.1 could be designed as: "To reach any other subnet in 192.168.0.0/16, send to gateway 192.168.2.1". This route would cover reaching subnets 192.168.2.0 and 192.168.3.0 (I would need to add two separate route entries, just use the one generic entry). So in summary, in this demo 192.168.0.0/16 was not necessary, but I used it because I was thinking ahead to future scenarios of using virtual networks in VirtualBox. I should have explained that more in the video.
Might I suggest that you try out the command ipcalc(1) to get more information. $ ipcalc 192.168.0.0/16 Address: 192.168.0.0 11000000.10101000. 00000000.00000000 Netmask: 255.255.0.0 = 16 11111111.11111111. 00000000.00000000 Wildcard: 0.0.255.255 00000000.00000000. 11111111.11111111 => Network: 192.168.0.0/16 11000000.10101000. 00000000.00000000 HostMin: 192.168.0.1 11000000.10101000. 00000000.00000001 HostMax: 192.168.255.254 11000000.10101000. 11111111.11111110 Broadcast: 192.168.255.255 11000000.10101000. 11111111.11111111 Hosts/Net: 65534 Class C, Private Internet So here you see that the first two byte is network, so that is used to decide if a machine address is on the same network or not. So, /24 is the usual size, as it give a network with place for 253 machines, and /16 will get you 2^¹⁶ -2 addresses. If you have many /24 networks, you can collect them under the same router direction. So 192.168.0.0/16 will be a route for all networks that start with 192.168.0.0, for example 192.168.0.0/24, and 192.168.1.0/24 etc up to 192.168.255.0/24.
I am currently working on a lab environment "tap0" interface. When I type the command route, my "tap0" interface is not showing a default gateway address. How do I find the router on this network?
Clearest and crispest explanation about the subject. No frills. Thanks Steve.
Just what I needed - thanks! I'm familiar with IP itself, but I was always a bit hazy about the Unix-style routing tables. The explanation that it searches for the longest match was particularly helpful.
Loved this explanation. Calm, precise, in depth. Thanks a lot!! 🤓
You are definitely one of the best teachers on RUclips.
Excellent...I always stuck in routing.. But this is really fantastic explanation and exactly what I was looking for.appreciate if you show routing for multi.nic configured server.
The route(1) is obsoleted, you should use ip(1) now, like "ip route show". It do the same, and more.
thanks for this, useful for beginners like me trying to figure out how computers and their networks route to other systems!
Thanks, it is so clear
you saved my day
Thanks a lot Steven. I've set up the same network but with "netplan" tool (I'm using Ubuntu 22.04). Now PCs from different networks see each other (ping goes fine) and next time I'll connect Kali Linux to start its tools and learn ethical hacking
1:49 route -n
1:55 in order to reach some destination, send to some GATEWAY (or router) 2:06 *gateway is another word for router*
Very nice explanation. Thank you.
Great tutorial. Thanks
Superb ...truly helpful
It would also work if you on the server or client removed the default router and added an new to the router instead. That is the default route on the server is change from 10.0.2.2 to 192.168.2.2. It will use the router for all transmissions out on the internet from the server, instead of using the 10.0.2.2.
To test routing, try the command tracepath(1) or traceroute(1) and you will see which routers will be used between the current computer and destination.
Nice video, thanks. Would be nice to see how the router itself was set up. You said it was another Linux VM? You somehow used VirtualBox to attach two network interfaces to it and manually set up the routes?
Yes, that is not anything strange. You can have up to four different interfaces in a VB virtual machine. And yes, it is explained in a previous video.
I like it. Good. Great that it's with virtual box
Perfect thanks!
you does'nt explained the netmask 255.255.0.0 with network 192.168.0.0 why it is 16 and not 24.
For this small network you could use 192.168.1.0/24. However I used 192.168.0.0/16 as in the future I plan to have network with three chained subnets, e.g. 192.168.1.0 connected to 192.168.2.0 connected to 192.168.3.0. Then a route on 192.168.3.1 could be designed as: "To reach any other subnet in 192.168.0.0/16, send to gateway 192.168.2.1". This route would cover reaching subnets 192.168.2.0 and 192.168.3.0 (I would need to add two separate route entries, just use the one generic entry).
So in summary, in this demo 192.168.0.0/16 was not necessary, but I used it because I was thinking ahead to future scenarios of using virtual networks in VirtualBox. I should have explained that more in the video.
Might I suggest that you try out the command ipcalc(1) to get more information.
$ ipcalc 192.168.0.0/16
Address: 192.168.0.0 11000000.10101000. 00000000.00000000
Netmask: 255.255.0.0 = 16 11111111.11111111. 00000000.00000000
Wildcard: 0.0.255.255 00000000.00000000. 11111111.11111111
=>
Network: 192.168.0.0/16 11000000.10101000. 00000000.00000000
HostMin: 192.168.0.1 11000000.10101000. 00000000.00000001
HostMax: 192.168.255.254 11000000.10101000. 11111111.11111110
Broadcast: 192.168.255.255 11000000.10101000. 11111111.11111111
Hosts/Net: 65534 Class C, Private Internet
So here you see that the first two byte is network, so that is used to decide if a machine address is on the same network or not.
So, /24 is the usual size, as it give a network with place for 253 machines, and /16 will get you 2^¹⁶ -2 addresses. If you have many /24 networks, you can collect them under the same router direction. So 192.168.0.0/16 will be a route for all networks that start with 192.168.0.0, for example 192.168.0.0/24, and 192.168.1.0/24 etc up to 192.168.255.0/24.
I am currently working on a lab environment "tap0" interface. When I type the command route, my "tap0" interface is not showing a default gateway address. How do I find the router on this network?
Hi Steven , can you do tutorials about shell scripting ? thank you.
great