Hello,
I'm currently taking a networking class at my university and I'm a member of a group and my group is assigned a virtual network to configure. We just learned how to configure static routes on Cisco and Linux Quagga routers. I'm really loving the class so I decided to start my own virtual internal network at home using virtual box. I just setup two virtual machines, one of them is a linux mint machine that's has an adapter that's attached to an internal network named net 0. The other is a cent OS machine that's functioning as a router which is running linux quagga. The router has two interfaces, one for the internal network named net 0 and the other is a bridged adapter with an IP from the private network that the rest of the machines in my home have. The linux router has internet, but the linux mint machine doesn't. What I want to do is give the linux Mint machine internet access, but not from an additional interface, I want that machine to get internet from the router. Very similar to how a wireless device in a home being services by comcast or ATT would get internet from a wireless router. Is that possible in virtual box?
Routing Question Linux Quagga
-
BillG
- Volunteer
- Posts: 5106
- Joined: 19. Sep 2009, 04:44
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 10,7 and earlier
- Location: Sydney, Australia
Re: Routing Question Linux Quagga
It is certainly possible if you configure the router correctly. I started using VirtualBox many years ago solely to test network configurations. Virtual networks work just like physical ones.
Bill
Re: Routing Question Linux Quagga
BillG wrote:It is certainly possible if you configure the router correctly. I started using VirtualBox many years ago solely to test network configurations. Virtual networks work just like physical ones.
The problem that I'm having is that my comcast wireless router at my house doesn't have the full functionality of a real router so I can't set a static route on my comcast wireless router that points to network that the virtual router connects to. Wireshark also proved that what I'm saying is correct.
Here's my setup
Host A
eth0: IP 10.0.2.2/24 (INTERNAL NETWORK in Virtual Box)
Router 1
eth0: IP 10.0.2.1/24 (INTERNAL NETWORK in Virtual Box)
eth1: IP 10.0.0.10/24(Private IP just the like the rest of the devices in my home)
Now with quagga on Router 1, I configured a default route to my comcast router which is also connected to router 1's interface eth1.
IP route 0.0.0.0/0 10.0.0.1
When I ping from Host A(10.0.2.2) to my comcast router(10.0.0.1) wireshark detected from my PC that ICMP packets to did reach 10.0.0.1, but they were not able to return to the sender due to an issue with a port.
I can only assume that the problem is being caused by the fact that I can't tell my comcast routers that If I want to reach network 10.0.2.0/24, that the next hop would be 10.0.0.10(eth1 interface on R1). I'm looking for a solution this problem because I'm stuck.
-
BillG
- Volunteer
- Posts: 5106
- Joined: 19. Sep 2009, 04:44
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 10,7 and earlier
- Location: Sydney, Australia
Re: Routing Question Linux Quagga
If you can't add a static route to your physical router that is the end of the story. You cannot make other changes anywhere else to compensate for that. If the packets never get past the physical router, no part of your virtual network will ever see them. In fact you should not need any static routes to get the traffic from your inner subnet to the gateway router. That bit should work using default routing. It is getting the traffic from the gateway router to the inner router which is hard (and when you need static routes).
Routing is a two-way process. It is a waste of time setting static routes to get packets from point A to point B if there is no return path from B to A (as you have found).
Routing is a two-way process. It is a waste of time setting static routes to get packets from point A to point B if there is no return path from B to A (as you have found).
Bill
Re: Routing Question Linux Quagga
I figured out what I was doing wrong. The router was only part of the problem. I ended up going through my closet and finding an old netgear router which allowed me to configure static routes on it so that problem was solved, but I still wasn't able to ping any computers on my virtual network or vice versa. When my ping test failed, I started to suspect that the virtual linux router was also part of the problem so I setup another virtual router and computer on my virtual network for testing purposes. I started testing the network by pinging different devices from the new virtual computer and I had the same problem that I was having before. The new computer could ping itself and all of the interfaces on the router, but it couldn't ping anything beyond that. Also, none of the other devices that weren't directly connect to it could ping it as well. After doing research I found out that ip fowarding must be enabled on on a linux machine in order for that computer to be able to forward packets between interfaces on its motherboard, and you do that by simply echoing a 1 into the ip_forward file "echo "1" > /proc/sys/net/ipv4/ip_forward." More information here https://openmaniak.com/quagga_tutorial. ... forwarding. Once I did that, everything worked fine. Another thing, echoing a 1 into that file only temporary solves the problem. You have to create a script that does this for you on boot so that you doing it manually every time the linux machine is powered off and on because the linux kernel echos a 0 into that file by default.
Last edited by socratis on 19. Feb 2017, 05:08, edited 1 time in total.
Reason: Removed unnecessary verbatim quote of the whole previous message.
Reason: Removed unnecessary verbatim quote of the whole previous message.
-
BillG
- Volunteer
- Posts: 5106
- Joined: 19. Sep 2009, 04:44
- Primary OS: MS Windows 10
- VBox Version: VirtualBox+Oracle ExtPack
- Guest OSses: Windows 10,7 and earlier
- Location: Sydney, Australia
Re: Routing Question Linux Quagga
Yes, IP forwarding needs to be enabled, but I would expect that installing any sort of routing software package would do that for you.
Bill