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 »

Technologov: enough of the chit-chat with Sanz, Back to work now. Here is the one thing I see as a problem following your instructions and diagram/ graphic: The windows internet connection sharing requires that the IP address 192.168.0,1 be open and available for connection sharing. It is already used by the ISP to create their network (I guess they just enable ICS and then glob stuff from there) and when I tried to create it I just get a failure message.

There is a program called NAT32 that I looked at (it's from Australia) that will let you try it for 2 hours to see if it works and then you pay for it. They claim that it not only overcomes the IP problem but can connect both of my accounts together and allow both computers to access both accounts simultaneously as well as cook dinner, wash the dog and do the laundry I think.

Any thoughts on this problem?
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:

output for technologov

Post by nobodie »

Alright, I finally got a chance to sit down and work through all this stuff. here is roughly what I did and then I'll add the output of everything that looks important.

So, I had the working connection through the windoze guest, its still working fine. This uses eth0, br0, tap0 and vbox0 as interfaces. The Network adapter 0 in the VB GUI is set to Host Interface with vbox0 as the interface connection. This was created using the virtualbox admin commands as per the usermanual.

So I added a br1, tap1, tap2 and vbox1. I bridged the tap1 and tap2 and then changed the VB GUI network setup to have a second active network adapter that acts as a host interface and connects with vbox1. This all exists (see ifconfig below) but is not active (no inet IP address ).

I do not have dhcpcd installed so your first suggestion to use that to activate this bridge won't work, and using route didn't work as well, I don't know why really, the error was something strange.

so let me give you what I can here:

~$ ifconfig -a
br0 Link encap:Ethernet HWaddr 00:1A:92:04:B4:E0
inet addr:192.168.0.217 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::21a:92ff:fe04:b4e0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2606543 errors:0 dropped:0 overruns:0 frame:0
TX packets:29746 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:153717272 (146.5 MB) TX bytes:4911984 (4.6 MB)

br1 Link encap:Ethernet HWaddr 00:FF:1E:00:84:F0
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

eth0 Link encap:Ethernet HWaddr 00:1A:92:04:B4:E0
inet addr:192.168.0.217 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::21a:92ff:fe04:b4e0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2775022 errors:0 dropped:0 overruns:0 frame:0
TX packets:91360 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:230323990 (219.6 MB) TX bytes:16727685 (15.9 MB)
Interrupt:17 Base address:0x8000

lo Link encap:Local Loopback
LOOPBACK MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap0 Link encap:Ethernet HWaddr 00:FF:47:80:8C:9D
inet6 addr: fe80::2ff:47ff:fe80:8c9d/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:6 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap1 Link encap:Ethernet HWaddr 00:FF:BA:DD:0F:78
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

tap2 Link encap:Ethernet HWaddr 00:FF:65:22:BC:49
BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)

vbox0 Link encap:Ethernet HWaddr 00:FF:82:F9:2E:6C
inet6 addr: fe80::2ff:82ff:fef9:2e6c/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:60844 errors:0 dropped:0 overruns:0 frame:0
TX packets:2696217 errors:0 dropped:84721 overruns:3 carrier:0
collisions:0 txqueuelen:500
RX bytes:11633180 (11.0 MB) TX bytes:221676733 (211.4 MB)

vbox1 Link encap:Ethernet HWaddr 00:FF:1E:00:84:F0
inet6 addr: fe80::2ff:1eff:fe00:84f0/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:354 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:6 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:104173 (101.7 KB) TX bytes:0 (0.0 b)

***********************************************************************


~$ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 br0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 eth0
0.0.0.0 192.168.0.1 0.0.0.0 UG 100 0 0 br0

***************************************************************************

~$ brctl show
bridge name bridge id STP enabled interfaces
br0 8000.001a9204b4e0 no eth0
vbox0
br1 8000.00ff1e0084f0 no tap1
tap2
vbox1

***************************************************************************

~$ sudo route add -net 0.0.0.0 gw [192.168.0.1] dev tap2
SIOCADDRT: No such process


What else can I get you?

yes i know this is not exactly what you prescribed, not that I am trying to do it wrong, but i didn't want to lose what was working already
as in the past, the future is in eggs
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

hAllOoo.. nobodie,
here I'm again. I've checked it out on my test machine.
Let's do it step by step.

For testing purposes you should better disable the Network Manager.
I prefer to setup it with tap devices because we need another tap and then it isn't mixed up with vbox0.

Get Needed software and settings (see also user manual chapter 6.5.1.1 using Debian and Ubuntu’s native methods):

Code: Select all

$ sudo chgrp vboxusers /dev/net/tun
$ sudo chmod g+rw /dev/net/tun
$ sudo aptitude install uml-utilities
$ sudo adduser nobodie uml-net   #logoff, logon
Setup your /etc/network/interfaces like this:

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

# Setting up a bridge ###########
auto eth0
iface eth0 inet manual
    up ifconfig $IFACE 0.0.0.0 up
    down ifconfig $IFACE down

auto tap0
iface tap0 inet manual
    up ifconfig $IFACE 0.0.0.0 up
    down ifconfig $IFACE down
    tunctl_user nobodie

auto br0
iface br0 inet manual
    up ifconfig $IFACE 0.0.0.0 up
    down ifconfig $IFACE down
    bridge_ports eth0 tap0
# End setting up a bridge ######
Then do:

Code: Select all

$ sudo /etc/init.d/networking restart

$ /sbin/ifconfig
br0       Link encap:Ethernet  HWaddr 00:0B:CD:47:4B:DF
          inet6 addr: fe80::20b:cdff:fe47:4bdf/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:468 (468.0 b)

eth0      Link encap:Ethernet  HWaddr 00:0B:CD:47:4B:DF
          inet6 addr: fe80::20b:cdff:fe47:4bdf/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:273 errors:0 dropped:0 overruns:0 frame:0
          TX packets:291 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:91818 (89.6 KiB)  TX bytes:34044 (33.2 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:76 errors:0 dropped:0 overruns:0 frame:0
          TX packets:76 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:5976 (5.8 KiB)  TX bytes:5976 (5.8 KiB)

tap0      Link encap:Ethernet  HWaddr 7A:F9:35:F6:3E:99
          inet6 addr: fe80::78f9:35ff:fef6:3e99/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:220 errors:0 dropped:0 overruns:0 frame:0
          TX packets:250 errors:0 dropped:91 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:26803 (26.1 KiB)  TX bytes:86260 (84.2 KiB)

$ /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
$
As you can see there is not even one IP address (except lo device of course). This avoids confusion and we don't need them at this time.

Attach tap0 to the Network Adapter 0 of the virtual machine. Start the VM and setup the first Local Area Connection.

Stop here.
This is the configuration you know with vbox0 since weeks but only with tap0. It MUST run like it! Test it carefully from within your guest and only go on if it works.

In the next step add this to /etc/network/interfaces:

Code: Select all

auto tap1
iface tap1 inet static
    address 192.168.3.2
    netmask 255.255.255.0
    gateway 192.168.3.1
    tunctl_user nobodie
And do:

Code: Select all

$ sudo /etc/init.d/networking restart

$ /sbin/ifconfig tap1
tap1      Link encap:Ethernet  HWaddr 0A:37:2D:EC:88:F5
          inet addr:192.168.3.2  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::837:2dff:feec:88f5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:105 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

$ /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.3.0     0.0.0.0         255.255.255.0   U     0      0        0 tap1
0.0.0.0         192.168.3.1     0.0.0.0         UG    0      0        0 tap1
$
Attach tap1 to the Network Adapter 1 of the virtual machine. Start the VM and setup the second Local Area Connection.
Image

Now from your host you should be able to ping 192.168.3.1 and the IP from the first adapter in the guest.

From your guest you should be able to ping 192.168.3.2, your router 192.168.0.1 and www.virtualbox.org.

Now finally we will connect the host thru the guest to the internet:
On the first Local Area Connection (that tap0 is connected to) set properties... Advanced tab
Image
Click OK and then Yes on the next message box coming up but we have to correct that. On the second Local Area Connection (that tap1 is connected to) set the IP again to that shown above.

Now you should be able to connect to the internet from within your host.
Last edited by Ingo on 22. Nov 2007, 23:34, edited 1 time in total.
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

Now it's only one little step to connect the host to your LAN and let your daughters PC connect thru the host with its guest to the internet. We will setup a VLAN with subnet 192.168.2.0 on top of your LAN with subnet 192.168.0.0. To simplify this we will only use static IP addresses.

First change /etc/network/interfaces:

Code: Select all

#auto br0
#iface br0 inet manual
#    up ifconfig $IFACE 0.0.0.0 up
#    down ifconfig $IFACE down
#    bridge_ports eth0 tap0

auto br0
iface br0 inet static
    pre-up echo 1 > /proc/sys/net/ipv4/ip_forward
    address 192.168.2.1
    netmask 255.255.255.0
    bridge_ports eth0 tap0
    post-down echo 0 > /proc/sys/net/ipv4/ip_forward
But your guest will send all packets belonging to your subnet (192.168.2.0) to the internet. So we have to tell him not to do this by a route to your VLAN. Do this on the guest:

Code: Select all

route -p add 192.168.2.0 mask 255.255.255.0 192.168.3.2
Give your daughters PC a static IP address 192.168.2.2 netmask 255.255.255.0 gateway 192.168.2.1. Don't forget to setup its DNS-Server.

That's it.
Ingo
Volunteer
Posts: 731
Joined: 22. Aug 2007, 10:13
Location: Germany

Post by Ingo »

Your /etc/network/interfaces should now look similar like this:

Code: Select all

# The loopback network interface
auto lo
iface lo inet loopback

# Setting up a bridge ###########
auto eth0
iface eth0 inet manual
    up ifconfig $IFACE 0.0.0.0 up
    down ifconfig $IFACE down

auto tap0
iface tap0 inet manual
    up ifconfig $IFACE 0.0.0.0 up
    down ifconfig $IFACE down
    tunctl_user nobodie

#auto br0
#iface br0 inet manual
#    up ifconfig $IFACE 0.0.0.0 up
#    down ifconfig $IFACE down
#    bridge_ports eth0 tap0

auto br0
iface br0 inet static
    pre-up echo 1 > /proc/sys/net/ipv4/ip_forward
    address 192.168.2.1
    netmask 255.255.255.0
    bridge_ports eth0 tap0
    post-down echo 0 > /proc/sys/net/ipv4/ip_forward
# End setting up a bridge ######

auto tap1
iface tap1 inet static
    address 192.168.3.2
    netmask 255.255.255.0
    gateway 192.168.3.1
    tunctl_user nobodie
The interfaces look like this:

Code: Select all

$ /sbin/ifconfig
br0       Link encap:Ethernet  HWaddr 00:0B:CD:47:4B:DF
          inet addr:192.168.2.1  Bcast:192.168.2.255  Mask:255.255.255.0
          inet6 addr: fe80::20b:cdff:fe47:4bdf/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1019 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1020 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:111861 (109.2 KiB)  TX bytes:597748 (583.7 KiB)

eth0      Link encap:Ethernet  HWaddr 00:0B:CD:47:4B:DF
          inet6 addr: fe80::20b:cdff:fe47:4bdf/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2739 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2651 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1587658 (1.5 MiB)  TX bytes:783725 (765.3 KiB)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:140 errors:0 dropped:0 overruns:0 frame:0
          TX packets:140 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:12086 (11.8 KiB)  TX bytes:12086 (11.8 KiB)

tap0      Link encap:Ethernet  HWaddr 4A:80:15:F0:0B:93
          inet6 addr: fe80::4880:15ff:fef0:b93/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1625 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1857 errors:0 dropped:94 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:186439 (182.0 KiB)  TX bytes:1485526 (1.4 MiB)

tap1      Link encap:Ethernet  HWaddr BA:CE:AA:D8:A4:44
          inet addr:192.168.3.2  Bcast:192.168.3.255  Mask:255.255.255.0
          inet6 addr: fe80::b8ce:aaff:fed8:a444/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1734 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1494 errors:0 dropped:301 overruns:0 carrier:0
          collisions:0 txqueuelen:500
          RX bytes:1507666 (1.4 MiB)  TX bytes:177612 (173.4 KiB)

$ /sbin/route -n
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.3.0     0.0.0.0         255.255.255.0   U     0      0        0 tap1
192.168.2.0     0.0.0.0         255.255.255.0   U     0      0        0 br0
0.0.0.0         192.168.3.1     0.0.0.0         UG    0      0        0 tap1
$
Hope it works also for you.
.
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 »

Hi Ingo, sorry, i've been out of touch.
What finally happened was that all of my fussing about the internet connection finally drove my "handlers" crazy and they got me my own private connection which gave me Linux connectability without "endangering their network": it turned out the people in the IT department were afraid that "Linux would break their network" so because I was getting around this and getting ready to run Linux on their network they gave up and got me a private ISP account. I find all this sadly but hilariously funny.

So, the fantastic part is that with Technologov and your work it was possible to do this thing. I think it goes to prove how amazing VB really is, when you get right down to it, and looking at your instructions, it would work pretty quickly and solve the problem. This is fantastic!

Finally, I can't thank you and Technologov enough. Yes on the surface maybe it didn't get finished but the proof of concept might pay off much later. I am kind of proud to have been even a 2-bit player in it. So, i can't thank the two of you enough.
as in the past, the future is in eggs
Post Reply