Setup a Linux client, router and server inside VirtualBox, and establish an internal network between them. Includes setting the NAT and Internal Network options in VirtualBox, as well as setting the routing table inside Linux.
The best tutorial I have ever seen on the internet. Steven has a god gift....... "being a teacher". He explains with great dexterity. God bless u man ! Keep spreading the knowledge.
I've been working on this configuration for the past couple days and just got everything wired up! I was able to see the ping requests and replies coming through the router with tcpdump. It was such a thrill, appreciate your help Steve!
Good video, thanks. Some suggestions. You should really not use ifconfig(8), but ip(8) instead. One should use "ip address", "ip route" and "ip neigh" instead of ifconfig(8), route(8) and arp(8) which are all obsoleted. If you have static addresses on the machine, you should also change IPv4-address 127.0.1.1 to the proper IPv4 address in /etc/hosts. The 127.0.1.1 is just a hack if you are using a machine that changes networks, like a laptop. In /etc/network/interfaces, you should not use "broadcast" nor "network". That is because they are calculated by the Linux kernel, so if you don't set them, you can't set the to the wrong value. ;-) If you really want that, then use ipcalc(1) with IP-address and netmask, to calculate broadcast and network correctly. (And your spelling errors would not made any difference, as it isn't needed :-D ) Do you really need the post-up and pre-down on the server or client? Isn't it easier to just add "gateway 192.168.1.1" to tell the client where the router is and "gateway 192.168.2.2" to tell the server that same? It is a bit strange to use different netmask in "netmask" directive and in the ip router command. Tip, use argument "-c" to set number of pings to do, like: "ping -c3 192.168.1.1" so you don't need to break with Ctrl-C. ;-) And by these added tip, a good video (especially as I don't need to do it myself) :-) I love VirtualBox and to play with networks. Next step is just remove those NAT interfaces from the client and server. Then make the first interface on the router a bridged network, add NAT iptable directives in /etc/network/interfaces (as it say in Debian wikipedia site wiki.debian.org/) and we have NAT-ed IPv4 router. Maybe use ufw(8) to set up firewall and forwarding rules in the firewall. Really like ufw(8), now when it has added routing.
Nice and concise. The port forwarding part was a bit weird as I spent 2 hours googling on how to make that happen, but did not watch through the end of the video :( Thank you very much, had a lot of fun doing this.
Thank you for the guide) Some comment: If you are seeing this video for settings network in ubuntu 18.04 and up, you should used netplan subsystem or install ifupdown (sudo apt install ifupdown), because in new versions ubuntu, netpan is primery subsystem for settings networks.
What a tutorial Steven. 2 years old but It made my day! Just one question, if we remove Nat adaptors from client and server, would they still be able to access external Internet via the router?
Hi! I have 2 VMs running openSUSE. one machine have 2 interfaces(NAT and internal), and the other only have internal. My first machine is a DHCP server and other is the client. Do you know how can i get internet access in machine with only internal adapter? without using a third machine as router. Machine A -> NAT(with internet) & internal network Machine B -> only internal network DHCP is working well
I have a question, why in those configurations still need enp0s3? can we delete that, just to make a sure connection to the internet is from enp0s8 in the client
Yes. virtnet is just a set of Bash/Windows cmd scripts that call the command line version of VirtualBox and create some common/useful network topologies. Some details at sandilands.info/sgordon/virtnet
Hi Steven thanks for your always very clear videos. I am new in networking and am trying to implement the network suggested in this tutorial. Everything seems ok ... the only thing I don't understand is the fact that, after setting, for example on the client, the internal card on static and having indicated the address, netmask ... etc I completely lose the dns. So if, for example, I ping 8.8.8.8 it is ok but if I ping www.google.com the name is not resolved. The problem arises mainly on apt-get update ... I don't solve in my case deb.debian.org so I can't install packages etc ... thanks for any support!
Can you explain how whonix workstation has only one network adapter configured as intnet and yet is able to connect to the internet via the whonix gateway? I could not get other vms to work in the same way i.e. set one vm with two adapters NAT and intnet and other vms intnet only.
Hello Sir, It was good video. I have one small doubt. In your topology, Can we communicate from Client to Server via Router in same same network ? e.g. if Client, Router and Server are in 10.1.1.0/24 network, can Client and Server talk each other ?? I am trying to run MPTCP between Server and Client and Router should be same network otherwise MPTCP won't work.
@@fahadnaim5099 شكرااا اخي،، بحت كثيرا عن طريقة لمشاركة الانترنت بين جهازين وهميين لكن لا احصل على نتيجة متلا ادا شغلت في بي ان فالجهاز الاول نفس الاي بي يكون في الجهاز التاني عبر internal network كمتال whonix gw
والله اخي اللي افتهمته من شرحك , ان هذا الفيديو هو جواب لاستفسارك. لان من خلال IP Forwarding تستطيع مشاركة الانترنيت من الحاسبة الثانية. لكن الاي بي طبعا من نفس الشبكة وليس نفسه. اعتقد كما تفضلت حضرتك ان ال (whonix gw and whonix workstation) مفيده. بس والله اني اسف لان مامشتغل عليهن من قبل
Hello….. Great video and I am looking to try this on a Raspberry PI….. Can anyone help with this challenge I have to complete. I want to create three individual virtual networks. 1: Point to point (i.e.) Client to Server, thus no network infrastructure. 2: Client - Router - Server 3: Client - WAN (i.e. a number of routers) - Server. I then want to RUN some TCP tests with different segment sizes. 256/512/1024/4096 and 64k. I will also have to adjust Window Sizing..... Whilst using TCPDUMP and/or Wireshark to capture the traffic and create a log-file that can be read and used to create some tangible data. Any ideas if this would be do-able within the Virtualbox environment.
Thank you for the video. I was able to get the server and client to ping each other. However, if I try to ssh, I get the following: "ssh: connect to host 192.168.2.22 port 22: No route to host". Did I miss something? Thank you again.
Probably not a problem anymore but after realizing that I had the same issue, I had to check the firewall status for both router and server and that was the root cause!
I did all the steps in the video but when i try to ping google or any other site nothing happens. Does anyone know what the problem is? much appreciated.