Page 1 of 1

How to set up Bridged Connection in Fedora

Posted: 17. Aug 2014, 22:15
by Sui-kun
Hello. I am a student who has been trying to set up a bridged connection between my Fedora guest and my Windows 7 host for the last 24 hours. Having searched Google to death with no solution, I am at my wit's end.

Goal: To set up LAMP (apache, mysql, and php) and phpMyAdmin on a Fedora guest on Virtual Box, then access phpMyAdmin from the host machine (Win7).

What I have done:
I have installed Virtual Box, Fedora, LAMP.
I have installed phpMyAdmin.
I have bridged my local area connection 2 to my VirtualBox Host-Only Network.

Under a NAT configuration, I was able to access phpMyAdmin using localhost/phpmyadmin. However, using the guest IP address in place of localhost resulted in a Forbidden error. Naturally, the host was unable to access phpMyAdmin with the NAT configuration.

I am now attempting to use a Bridged Connection with no luck. I manually assigned an IP to the guest-- 192.168.56.102. Pinging the host's IP address from within the guest will result in an error: "connect: network is unreachable." Pinging the guest from the host will result in "Request Timed Out".

Under Network adapters, I have attached Bridged Adapter with the name Realtek PCIe GBE Family Controller. Cable Connected.

Under Virtual Box Network settings, I have two Host-Only Ethernet Adapter networks listed, both of which have DHCP disabled. I don't think the Bridged Network uses them though.

Help me Obi-Wan Kenobi you're my only hope...

Re: How to set up Bridged Connection in Fedora

Posted: 17. Aug 2014, 22:25
by Perryg
192.168.56.* is the address range for the host-only and should not be used with Bridged as it will cause network errors.

If all you need it the host and guest to communicate you should use host-only with dhcp on. If you also want the Internet in the guest add a second adapter set to NAT.

http://www.virtualbox.org/manual/ch06.html

Re: How to set up Bridged Connection in Fedora

Posted: 17. Aug 2014, 23:34
by Sui-kun
Alright then. Going back to host-only.

I have:
1. Enabled DHCP on my Host-Only Network Details. Under the "Adapter" tab in the IPv4 Address, I have pasted my real IP address found through whatismyipdotcom. Under DHCP tab, I have the default values which are 192.168.56.101 with bounds between 101 and 254.
2. I have switched Fedora network settings for Adapter #1 to Host-Only Adapter, with the name of the Ethernet Adapter above. To keep it simple, I have not enabled NAT for the second adapter yet.

Under this configuration, I can access the apache test page through "localhost" on the guest as expected. Meanwhile, ifconfig lists two connections: one called "lo" and one called "p2p1" which I assume is the host-only connection because it lists its IP as 192.168.56.101.

The guest machine claims that it is connected. So I ping 192.168.56.101 in the konsole just to make sure. As expected, the ping goes through and packets are exchanged.

However, my goal is to access the guest FROM the host. How do I go about doing that? I'm guessing I should ping the guest from my host's command line, but what IP should I use?

Re: How to set up Bridged Connection in Fedora

Posted: 18. Aug 2014, 00:05
by Perryg
The host-only name implies all you should need to know of how to access the guest from the host. It does not work in any other way unless you have been messing with the adapter settings and routing tables which would be a very bad idea.

The host will have an IP address of 192.168.56.1 and the guest would be 192.168.56.101. NO gateway as there is not Internet and does not require a gateway.

localhost is not what you should use as it will confuse you. Every PC that has a network stack has the exact same IP 127.0.0.1 so pinging it will only show that the stack is available on the machine that you are using.

Re: How to set up Bridged Connection in Fedora

Posted: 18. Aug 2014, 00:40
by Sui-kun
Okay...

Well, upon pinging in the windows 7 command line, 127.0.0.1 and 192.168.56.1, packets are successfully received. As expected, because the host is pinging itself, right? Pinging the guest, 192.168.56.101, however, results in time outs.

All hope is lost.

Re: How to set up Bridged Connection in Fedora

Posted: 18. Aug 2014, 00:44
by Perryg
Check the windows firewall. It is not uncommon that it tries to block the traffic to the guest. You may need to add an exception.

Re: How to set up Bridged Connection in Fedora

Posted: 18. Aug 2014, 00:45
by Perryg
Also post the results of ifconfig -a from the guest

Re: How to set up Bridged Connection in Fedora

Posted: 18. Aug 2014, 01:24
by Sui-kun
Here they are:

lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 176 bytes 14012 (13.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 176 bytes 14012 (13.6 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0

p2p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.56.101 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::a00:27ff:fe6e:271b prefixlen 64 scopeid 0x20<link>
ether 08:00:27:6e:27:1b txqueuelen 1000 (Ethernet)
RX packets 31 bytes 5587 (5.4 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 92 bytes 9041 (8.8 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 10 base 0xd020

p7p1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.2.15 netmask 255.255.255.0 broadcast 0.0.0.0
inet6 fe80::a00:27ff:fe9b:9f3 prefixlen 64 scopeid 0x20<link>
ether 08:00:27:9b:09:f3 txqueuelen 1000 (Ethernet)
RX packets 1728 bytes 1265599 (1.2 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 1568 bytes 212450 (207.4 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 9 base 0xd240


p7p1 is the NAT connection.

I actually already added a 192.168.56.101 as an exception for the windows firewall, but I did double check that it was configured correctly.

Also, I didn't install guest additions. Might that have something to do with it?

Re: How to set up Bridged Connection in Fedora

Posted: 18. Aug 2014, 01:34
by Perryg
Guest additions have nothing to do with the network stack. Just improved video and mouse experience.

Now if you can ping 192.168.56.1 from 192.168.56.101 but not the other way around it is the firewall. (maybe in fedora) Also you need to make sure that you let Fedora set the adapter via dhcp as I said adding a gateway will cause the route to fail which most people set by mistake when trying to manually setup the network.

Re: How to set up Bridged Connection in Fedora

Posted: 18. Aug 2014, 01:51
by Sui-kun
Okay well, I just did another ping test. I don't know what happened, but when I ping 192.168.56.101 from my host machine, I get replies now. Albeit 1 packet is lost sometimes, but it's usually 0% loss. Success?

Unfortunately, putting 192.168.56.101 in my host web browser still results in connection timeout. I still can't access phpMyAdmin.

Re: How to set up Bridged Connection in Fedora

Posted: 18. Aug 2014, 02:00
by Perryg
Well the third part program would be where you should look. Tell me what is the purpose of phpMyAdmin anyway.
Also if you are using apache as the web server you need to make sure it is configured for an address and not local loopback.

Re: How to set up Bridged Connection in Fedora

Posted: 18. Aug 2014, 02:10
by Sui-kun
phpMyAdmin is a php module with a GUI interface that is supposed to make it easier to administer a server database. I'm supposed to use it to create a website with which to administer a database.

However, reaching phpMyAdmin is not my current problem because I can't even reach the apache test page on the host machine. As I said, inputting the guest ip on the host browser will result in a time-out.

I am using Apache as the web server. Configure it for an address and not a local loopback? I'm going to look that up right now, but if you know how, it would be great if you could tell me.