PPPoE in guest system

Discussions related to using VirtualBox on Linux hosts.
nobodie
Posts: 51
Joined: 20. May 2007, 11:46
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: winxp, pclinux, kubuntu, jolicloud, arch, solaris,
Location: Suzhou,Jiangsu, China
Contact:

Post by nobodie »

well, everything is good now. Here is the (semi-humorous) of how:

I called the useless guy from the ISP in. I have discovered so much about the ISP that it is,,,,, well this is China (TIC) as we say. So, he did his usual nothing on my daughter's box. I asked him to help me with this install of their pppoe program. he shyed like a beat horse. Well, he knew I had some kinky things going on here, you know, Linux. Seeing the virtual windows on the linux desk didn't help, he was afraid to touch the keyboard (I'm not kidding about this, he didn't even want to look!). I finally calmed him enough to get him to delete the instance of the pppoe program that they had running and let me remove it from the virtual machine ("but you won't have internet! I don't have internet now. But you do have internet now, it says that it connected. But it doesn't connect and windows is too stupid to figure it out so let's delete and reinstall. But you'll lose your internet. I can't lose something I don't have. let's remove it and then we'll put it back. But you'll lose your internet---- this went on for 5 minutes, 5 precious minutes of my life)

I got him to remove it (the directions and controls are all in Chinese and I didn't have language stuff installed) so then I reinstalled the script which was recognized then by the VM and the bridge and everythign went swimmingly. thus I am writing to you on that box in my virtual windows.

so, there was no worry with 1.5.2, it did require a reinstall of the guest additions as well as the PPPoE script from my flash drive.

So to make this basically a how-to for others from China:
Follow the manual to establish a bridge and a network using a Host network insteadl of the default NAT. (by the way the manual is excellent on this, clear and precise instructions) Install the script that is available freely from people who have the connection. Bingo. I think doing Ingo's recommended filter change (of just the bridge filter) might also be necessary, i have done it and didn't undo it to see if that caused problems.

I'm doing this partly because I have run into others here in China who have a similar problem and I can link them to this post and maybe to VB in general because it really works well.

So.... still I want the final solution, to be able to Linux online (updates and upgrades and general safe-surfing and all that) and just use a transparent VB as my (fill in correct word here). so, I will go back up this set of messages to where Ingo mentioned some ideas about this above.

Ingo: have you had any further ideas about how to accomplish this?
as in the past, the future is in eggs
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Excuse me, - I read just briefly your problem,- (I have not read everything) but I already have a solution, because I made similar things in the past.

I have drawn a network topology for you.

You need to disable all IPs in the tap0/eth0/br0 line.

This topology requires 1 physical PC with 2 physical network cards. (you can have 1 NIC, Network Interface Card, if you want Internet only for yourself)

You need install your proprietary software onto the guest.

Use cross-over cable to connect to other home PC. (if you have several, you'll need hardware switch)

Image

-Technologov
nobodie
Posts: 51
Joined: 20. May 2007, 11:46
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: winxp, pclinux, kubuntu, jolicloud, arch, solaris,
Location: Suzhou,Jiangsu, China
Contact:

Post by nobodie »

I'm excited! But still unclear, let me describe fully my setup and see if you can walk me through the setup.

I have two computers connecting together, and to the LAN, with a small 5 port hub. One of the computers is set to dual boot Linux Ubuntu(7.04) and WindozeXP. This computer usually uses windows to go online, but i would like to wean it off of that at some point.

The other computer runs Ubuntu (7.10) and Virtual Box with windozeXP as the guest. Both of the Windoze installs, virtual and full are connected to the internet at the present time using the chinese Amtium 1.1 script.

As you know the proprietary garbage script (believe me this stuff is baaaad) runs only in windoze, so I was hoping to use the virtual windoze as a "server" (forgive me if my terminology is mistaken) that would allow internet access to the Linux host. I could do this twice with both machines since I have two "accounts" (apparent accounts I think, don't ask, don't tell). That might be the best approach since the connection as is can be tediously slow.

So, if you could walk me through the process of just setting up one computer using virtual box to access the internet for the linux host i could just repeat that and have everything cool. I think anyway :D
as in the past, the future is in eggs
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

Look at the topology. What you see ?

Part1:

Eth0 must be physically connected to Internet (ADSL modem?). Do not connect Eth0 to hub.

You need to create bridge and TAP to bridge that upper line (tap/eth/br0') to the VirtualBox guest.
This step is described in chapter: "Intermediate Topic: Networking via Host Bridging" in my guide: http://forgeftp.novell.com/lfl/.html/virtualbox.html

Install your software on the guest. Now you will have Internet in the guest.

=================================================
Part2:

Currently your Host is not logically connected to the Internet. Only physically.

Let's connect host now.

You create a second bridge (br1), and two Tunnel AdaPters (TAP) tap1 and tap2. Add tap1 and tap2 to your br1.
This procedure is described too in the guide.

Guest needs to have two virtual NICs, one mapped to Host's tap0 and to tap1 respectively.

Route all your host's traffic via tap2.

=================================================
Part3:
Connecting other home computes to your internet:

Eth1 must be physically connected to hub.

Add Eth1 to br1. All other PCs will automatically get their connection (via DHCP).
=================================================
Implementation Steps:
Step 1. install uml_utilities and bridge-utils packages.

Step 2. Let's build your logical topology: (assuming your eth0 is physically connected to ADSL modem and eth1 is physically connected to hub - ADSL modem and hub must be two separate physical devices, not all-in-one combo)

(-u tux, will means username "tux" - use YOUR username)
# tunctl -t tap0 -u [tux]
# tunctl -t tap1 -u [tux]
# tunctl -t tap2 -u [tux]

# brctl addbr br0
# brctl addif br0 eth0
# brctl addif br0 tap0

# brctl addbr br1
# brctl addif br1 eth1
# brctl addif br1 tap1
# brctl addif br1 tap2

All logical addresses (IPs) needs to be removed from Host on all interfaces. (taps/bridges/eth's)
-NOTE: If you don't remove IPs from Host, Host will hijack and interfere with your connections.

# ifconfig eth0 0.0.0.0 up
# ifconfig eth1 0.0.0.0 up
# ifconfig tap0 0.0.0.0 up
# ifconfig tap1 0.0.0.0 up
# ifconfig tap2 0.0.0.0 up
# ifconfig br0 0.0.0.0 up
# ifconfig br1 0.0.0.0 up

NOTE2: This configuration is temporal, and will lost after you restart your host PC. Good for testing, but not for work.

Step 3. Create VirtualBox VM with two NICs (Network Interface Cards), one mapped to Host's tap0, and other mapped to host's tap1.

Start it with Windows guest, install your software, and use Windows "Internet Connection Sharing (ICS)", to share your internet.

tap2 will be the adapter, that Host uses for his networking.
# dhcpcd tap2

-Technologov
Finally, route all your host's traffic via tap2.
# route add -net 0.0.0.0 gw [192.168.0.1] dev tap2

NOTE1:maybe this last step won't be needed, because DHCPcd may modify your routing tables already, not sure about this - don't use this if not necessary.
NOTE2: gw is gateway, or in your case - your Windows guest's IP.
nobodie
Posts: 51
Joined: 20. May 2007, 11:46
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: winxp, pclinux, kubuntu, jolicloud, arch, solaris,
Location: Suzhou,Jiangsu, China
Contact:

Post by nobodie »

Ok. But I have the top part of your topology created already as I understand it ( I am assuming that the TAP0 was created with the commands in the vbox instructions since I didn't directly create it using the Ubuntu tap creation tools (UML if i remember it correctly) since i hadn't downloaded them already)

But I run that back to the hub and connect using the windoze script without having to have the direct connection.

If that is the case can't I just create the second VB adapter (adapter1) without using a second network card? Especially since I won't use a twisted cable to tie in the second box, but rather repeat this setup with a second autonomous box. If you say it won't work I'll believe you and see about getting a second network card for my MB, but are you sure it is necessary?
as in the past, the future is in eggs
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

nobodie: I don't say that something will not work, unless I understand your network topology. It's not clear yet how you have it all connected.
nobodie
Posts: 51
Joined: 20. May 2007, 11:46
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: winxp, pclinux, kubuntu, jolicloud, arch, solaris,
Location: Suzhou,Jiangsu, China
Contact:

Post by nobodie »

I'm sorry, I was mistaken about my config that I am using, or perhaps it is a naming thing. What I did was to, in the network setup (under Settings in the VB window) set the host interface as "vbox0". I don't know if I have done the same as creating a "tap0" by doing this. If not then I am not sure what I should do for the settings gui (assuming it won't be set by the command line).

BTW, your description of setup and everything for VB at the link you provide is fantastic. Even using Ubuntu I am impressed by your logic, detail and organization and I could have used your link to great advantage. Very nice work!

Still I am not certain whether I can go ahead create a second host interface on adapter1 and name the interface vbox1 and use that as my connection for my linux host? In other words, I am onfused about the relationship between the GUI settings panel and the command line setup you have.

Thanks for your time and help
as in the past, the future is in eggs
nobodie
Posts: 51
Joined: 20. May 2007, 11:46
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: winxp, pclinux, kubuntu, jolicloud, arch, solaris,
Location: Suzhou,Jiangsu, China
Contact:

Post by nobodie »

I missed your previous request and so didn't give a complete description. I will try to improve it here:

This box is a intel core2 duo with the vanderpool VT chip. 2 Gigs of ram, a g7agp and a single network card on the 965 Mobo (an Asus P5N)

I connect it to the hub which connects out through the LAN to an ADSL router by pppoe. Using the directions in the VB user manual I set up a host network interface with a single bridge (br0) that connected eth0 (the network card) to vbox0 (the guest adapter0). That is it. Ingo suggested turning the filter off for the bridge-nf file which I did as well.

When that was set up I ran the funky script in the windoze guest and (after the guy from the ISP came and made a phone call to have my account name reactivated) I was online.

I hope that is more clear,
as in the past, the future is in eggs
Technologov
Volunteer
Posts: 3342
Joined: 10. May 2007, 16:59
Location: Israel

Post by Technologov »

I believe, that your "vbox0" is the same as my "tap0". Anyways, you need should allow second NIC in VBox, and connect it to tap1. This guest needs two virtual adapters, no matter how many physical adapters you have.

If you have single network card, then only you can use this system. Your second PC will have to connect separately, not via this PC.

Also create br1 and tap2. Connect br1 to tap1 and tap2.

Do exactly as in the topology, except don't use eth1 (because you don't have it).
nobodie
Posts: 51
Joined: 20. May 2007, 11:46
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: winxp, pclinux, kubuntu, jolicloud, arch, solaris,
Location: Suzhou,Jiangsu, China
Contact:

Post by nobodie »

Oh Well, situation normal (for me anyway). Lost all internet, the pppoe script won't reload on startup or, apparently run even if i treat it as a new install. Perhaps the problem is th ewindows ICs that you show in your topography. Because the greater LAN system uses 192.168.0.1 as its static address and ICS wants to use it for my address it won't allow the ICS to run.

If I still had the first setup running then I would try to run a program called NAT32 which searching th eproblem brought up a forum post in windows that said this should work around that problem, but it seems silly to build a network on a non-functioning base.

So, I am not sure how to back up from here and reset to where I was functioning. I am guessing (definitely only guessing) that it was th ereset of the IP's to 0 that tripped this problem. You mention that it shouldn't be permanent, but it seems to have acted that way. What do you think? and how do I return to previous status.

I know you're probably asleep as I write this so I will either eat breakfast and then putz with it or go hiking. Hmmmm hiking would be nice,

Later
as in the past, the future is in eggs
nobodie
Posts: 51
Joined: 20. May 2007, 11:46
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: winxp, pclinux, kubuntu, jolicloud, arch, solaris,
Location: Suzhou,Jiangsu, China
Contact:

Post by nobodie »

one curious thing that definitely bears on all this:
My network connections in the windows guest no longer shows the LAN but rather shows "LAN4" which wants to connect to adapter3. As well it shows LAN6" which wants to connect to adapter 5.

I get an immediate error message that i have "limited or no connectivity on LAN 4" and would get the same message on LAN6 except I disabled it. When I set adapter 3 as the host network it doesn't seem to make much if any difference.

I returned to the basic VB instructions for building a bridge and ran through them again. This didn't solve the LAN4/6 problem or get me any closer to connection. I have no network at all at this point.

I used system restore to return to friday when everything worked but this also didn't restore the network stuff to operational and i still have LAN 4. I disabled the other adapters in VB settings to get things simpler, since any increase in enabled adapters was creating more LAN connections that didn't connect.

so, that is where things stand at the moment, i had a wonderful hike though which makes me happy.

later!
as in the past, the future is in eggs
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

Technologov wrote:This topology requires 1 physical PC with 2 physical network cards. (you can have 1 NIC, Network Interface Card, if you want Internet only for yourself)
Hi Alexey,
very nice and clear structured professional configuration!
But to one who is not so familiar with networking it may be a little bit complicated to do all in one step. I suggest to do it first with one NIC as you mentioned above.
Is it OK??
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

Hello nobodie,
I'm impressed by the suggestion of Technologov and I'm interested in looking if it works also for me. I will check it on my computer first with one Network Interface Card. With this setup you cannot connect the two computers in your LAN but as you said it doesn't matter. I'll tell you when (and how) it works but it may take a little while. I'm a little bit busy with another problem. I've decided to upgrade my display environment with two new high resolution LCD monitors and spread the output over both. High resolution doesn't work in this mode but that isn't VirtualBox...
Will come back later.
nobodie
Posts: 51
Joined: 20. May 2007, 11:46
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: winxp, pclinux, kubuntu, jolicloud, arch, solaris,
Location: Suzhou,Jiangsu, China
Contact:

Post by nobodie »

I also am impressed with the presentation and studying the code makes it clear that it should work, but it didn't. I know now that vbox and tap are NOT the same: this shows up in ifconfig. But why everything crashed and bled out the way it did, that is confusing to me. I lost the connection I had as well as all network on the windows guest, why was that?

Anyway, i have returned the box to almost the same, almost but not quite. Here is what I did and what the result is (well the important result is that I'm back on line and on the network, but...)

I used the del commands in brctl and tunctl to remove the bridges (br0 and br1, even though I didn't install br1) as well as the vbox0,1 and 2 interfaces. Then i used ifconfig to re-remove the instances, or machines or however the box sees them. Checking ifconfig at this point seemed to show just lo and eth0 as interfaces.

Then I restarted the entire box (overkill I know, but i'm a restart kind of guy)and it took an incredibly long time to start up, like 20 minutes.

ifconfig showed the vbox0, tap0 and br0 back in the lineup. Well gooooooolly! i said.

so i started virtual box and set the network to my original settings with adapter 0 running a host interface through vbox0.

The network connections tab showed that darn LAN4 connection and it was connected to adapter 3, still. gosh darn it i said. but still i started the Amtium script and tried to connect the with pppoe and .... it connected on through.

HUH? yeah, i don't understand, and worst of all i can't wrap my head around any possible explanation short of divine intervention. So i have internet back on, but in a way i wish i didn't cause at least i thought i understood the problem, when in fact it appears i not only don't undertand the problem or the solution, i don't even really seem to understand anything at all.


HELP???
as in the past, the future is in eggs
nobodie
Posts: 51
Joined: 20. May 2007, 11:46
Primary OS: Fedora other
VBox Version: PUEL
Guest OSses: winxp, pclinux, kubuntu, jolicloud, arch, solaris,
Location: Suzhou,Jiangsu, China
Contact:

anything new?

Post by nobodie »

I haven't heard from anyone about this, and I was wondering if there had been any further thoughts about all this.

I still have this curious and spurious LAN4 that occasionally tells me it has little or no connection, but this doesn't seem to actually affect my network connectivity with either the building network or with the internet.

And I still want to use this to connect out with the Linux host, but it failed the last time i tried technologov's instructions, why i don't know, but it created this strange situation with LAN4 and I wanted to get that back to normal before I ventured forth once more.

Soooo, anybody have further thoughts or suggestions?
as in the past, the future is in eggs
Post Reply