coLinux
Edit Page
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 323: Line 323:
 
* so if you have a ipv6 network and you are using the pcap-bridge option this will not work, unless you disable or kill DAD
 
* so if you have a ipv6 network and you are using the pcap-bridge option this will not work, unless you disable or kill DAD
 
* ''duplicate address detected'' is fixed in coLinux 0.7.4, because new rule exclude our self as source mac.
 
* ''duplicate address detected'' is fixed in coLinux 0.7.4, because new rule exclude our self as source mac.
 
== Private Connection to Hosting OS via Loopback Adapters ==
 
In effect this approach creates a private connection (virtual network) between the coHost and the coGuest.<br />
 
Building a virtual network for your coHost and coGuests has the following advantages:
 
* in most setups it requires no hardware.
 
* it eliminates dependencies on physical hardware, like having a working physical network connection to get virtual networking to work (as is required by a classic NDIS or PCap bridge).
 
* the additional hop between the coGuest and the physical network used by the coHost allows for extra security measures (firewall on coHost).
 
Drawbacks are:
 
* the additional hop could mean more complicated network setup, like configuring the coHost to function as a router.
 
* no physical control over the network connection. eg. Yanking out a network cable will probably disconnect the coHost and coGuest from the internet but not from each other.
 
 
A number of methods are available to create a private connection (virtual network):
 
* bridge to the already supplied Windows Loopback Interface (which is bound to IP address 127.0.0.1).
 
** This approach will limit you to using an IP address inside linux in the 127.x.x.x range. Which is semantically quite strange, but perfectly valid. Also this IP address range cannot be changed easily as with a Microsoft Loopback Adapter.
 
* bridge to a new Microsoft Loopback Adapter.
 
** Advantage of this approach over the one using the "Windows Loopback Interface" is that you will be able to change the subnet the host and guest live on easily.
 
** Advantage over the TAP interface is that you can bridge as many guests as you see fit on the virtual adapter and they will all be able to communicate to each other and the windows host (if the network config permits this (same subnet etc.)).
 
** Drawback is you need to install a new hardware device which requires administrative privileges on Windows.
 
** [http://www.sklar.com/blog/index.php?/archives/55-Wrangling-coLinux-Networking.html An older blog post] (October 2004) by [[User:DavidSklar|DavidSklar]] describes troubles in setting up networking and ultimately uses a Microsoft Loopback Adapter instance to resolve the troubles. Although older, it is quite a nice in-depth how-to article.
 
** [[User:AndrewRoth|AndrewRoth]] reports the Microsoft Loopback Adapter did not work in his setup and discourages using this kind of networking setup. Instead he recommends adding a TAP interface for every coGuest as explained [[#TAP]].
 
* using a hardware loopback adapter.
 
** This approach is used primarily to overcome the disconnecting of coGuest an coHost when a network cable is removed from the physical network card.
 
** Drawback of this approach is that it requires custom hardware.
 
 
=== Using the Windows Loopback Interface ===
 
In the coLinux config file use:
 
<pre><nowiki>
 
eth0=pcap-bridge,"Loopback"
 
</nowiki></pre>
 
 
=== Using a new Microsoft Loopback Adapter ===
 
First you probably need to add a new virtual network interface (using the Microsoft Loopback Adapter driver). This is explained on numerous websites ([http://www.google.pl/search?q=install+%22Microsoft+Loopback+Adapter%22 Google Search]).
 
 
'''NOTE:''' When inspecting the new network adapter it reports it operates at 10mbit. This is not true, after empirical research my setup maxed out at 200mbit (25MByte/s) when transferring a 50MB random binary file from the guest to the host (using apache -> wget) and the same in the opposite direction (using lighttpd -> wget).
 
 
As explained on [http://support.microsoft.com/kb/839013 this Microsoft knowledge base article], the virtual adapter will try to get a dhcp address and eventually will fail and assign itself a private IP address in the 169.254.x.x range. In a typical setup you will specify a static IP on the virtual Loopback adapter. For a guide how to change the ip address in windows see [http://support.microsoft.com/kb/308199 this knowledge base article].
 
For simplicity sake we will use:
 
* subnet 192.168.1.x
 
* netmask 255.255.255.0
 
* loopback adapter ip 192.168.1.10
 
 
Now you need to bridge the new adapter to the coGuest using the following directives in the config file:
 
<pre><nowiki>
 
eth0=pcap-bridge,"Microsoft Loopback Adapter"
 
# or
 
eth0=ndis-bridge,"Microsoft Loopback Adapter"
 
</nowiki></pre>
 
 
When booting the coGuest the eth0 interface (in Linux) will be on the same (virtual) physical net as the new Microsoft Loopback Adapter. So if we set use an ip address in the same subnet, the host(Windows) and guest (Linux) will be able to connect to each other.
 
 
Using the following commands we can test if networking works in this setup.
 
<pre><nowiki>
 
$ ifconfig eth0 192.168.1.20 netmask 255.255.255.0
 
$ ping 192.168.1.10
 
PING 192.168.1.10 (192.168.1.10) 56(84) bytes of data.
 
64 bytes from 192.168.1.10: icmp_seq=1 ttl=128 time=0.000 ms
 
64 bytes from 192.168.1.10: icmp_seq=2 ttl=128 time=10.0 ms
 
64 bytes from 192.168.1.10: icmp_seq=3 ttl=128 time=10.0 ms
 
^C
 
--- 192.168.1.10 ping statistics ---
 
3 packets transmitted, 3 received, 0% packet loss, time 2010ms
 
rtt min/avg/max/mdev = 0.000/6.666/10.000/4.714 ms
 
</nowiki></pre>
 
Networking works when the ping command is successful.
 
 
=== Using a Hardware Loopback Adapter ===
 
[[User:DaveLynch|DaveLynch]] uses a hardware loopback adapter primarily to overcome the disconnected bridges when the UTP connection is lost.
 
 
<blockquote>I use a different LoopBack connector when operating "disconnected" I have an RJ-45 plug with pins 1&2 tied to pins 3&6 respectively. Windows believes the network is alive and colinux and windows can connect. DHCP does not work - unless you have a DHCP server either under Windows or colinux.</blockquote>
 
   
 
== Wireless ==
 
== Wireless ==
Line 569: Line 500:
   
 
You're done! Now that you have a working network, you may to enjoy relating the theoretical discussions herein to something akin to practice.
 
You're done! Now that you have a working network, you may to enjoy relating the theoretical discussions herein to something akin to practice.
 
== TAP - Private Connection with Hosting OS ==
 
 
<pre><nowiki>
 
+---+--------------+ +-------------------------+---+
 
| |first adapter-| <------------------->|-TAP virtual adapter | |
 
| |192.168.37.20 | coLinux Monitor | 192.168.37.10 | |
 
| +--------------+ (TAP) +-------------------------+ |
 
| | | |
 
| coLinux OS | | Hosting OS |
 
| | | | +-----------+
 
| +---------------| | | |192.168.0.1| . . . . . .
 
| |second adapter | +-----------------------------+ | Router |-----. internet .
 
| |192.168.0.10 | <------------------->| physical ethernet adapter |<--> | | . . . . . .
 
+--+---------------+ coLinux Monitor +-----------------------------+ +-----------+
 
(WinPcap)
 
</nowiki></pre>
 
 
 
 
 
 
Use this method to provide a high-speed private network between the
 
[[Getting_Started_with_coLinux#Terminology | Hosting OS]] and
 
[[Getting_Started_with_coLinux#Terminology | coLinux OS]]. This network will
 
be completely closed to the outside world.
 
A[[Getting_Started_with_coLinux#Terminology | coLinux OS]] can be configured to use this network on one interface and to use one of the other methods for Internet connectivity.
 
 
'''Advantages'''
 
*Run X applications on this network, while using a separate network for Internet connectivity
 
*High-speed. Communication does not make a round trip to an external network device
 
*Always available, even when network cable is unplugged.
 
 
===Configuration===
 
 
In the following example, a subnet of "37" is used. This is an an arbitrary number. If you already have a "37" network, it should be changed to something else. The hosts, "10" and "20" are also arbitrary.
 
 
==== On the Hosting OS ====
 
 
*The TAP-Win32 Virtual Adapter should have the following properties:
 
 
Set the TAP-Win32 device properties - available from 'Configure' button on 'General' tab of connection.
 
When Tap-Win32 Adapter properties window shows up, go to the 'Advanced' tab, select 'Media Status' item on the 'Property' list and set its 'Value' to 'Always connected'.
 
 
 
TCP IP protocol properties:
 
<pre><nowiki>
 
Ethernet adapter coLinux:
 
 
Connection-specific DNS Suffix . :
 
IP Address. . . . . . . . . . . . : 192.168.37.10
 
Subnet Mask . . . . . . . . . . . : 255.255.255.0
 
Default Gateway . . . . . . . . . : . . .
 
</nowiki></pre>
 
 
'''Note:''' Do not set the above default gateway on the windows side of the connection (leave it blank). Windows may lose internet connectivity if it is set.
 
 
*Verify that X Server will permit a connection from the CoLinux OS:
 
<pre><nowiki>
 
$xhost +inet:192.168.37.20
 
</nowiki></pre>
 
 
On Vista this doesnt work by default because the firewall blocks outgoing connections eg ping from colinux doesnt get reply. This can be solved by setting windows firewall to not monitor the Tap interface.
 
 
==== In the CoLinux OS ====
 
 
*Create a new interface in /etc/network/interfaces. For example:
 
 
<pre><nowiki>
 
 
auto lo eth0
 
 
iface eth0 inet static
 
address 192.168.37.20
 
network 192.168.37.0
 
netmask 255.255.255.0
 
broadcast 192.168.37.255
 
 
auto eth1
 
iface eth1 inet dhcp
 
 
</nowiki></pre>
 
 
Or, if you are using Gentoo, your /etc/conf.d/net file would look like:
 
 
<pre><nowiki>
 
 
# There should be no gateway="..." setting.
 
# The default file may contain one near the bottom.
 
iface_eth0="192.168.37.20 netmask 255.255.255.0 broadcast 192.168.37.255"
 
iface_eth1="dhcp"
 
 
</nowiki></pre>
 
 
In the example above, no gateway was set because it is assumed that another gateway has already been specified for a different interface.
 
'''Beware''' - If you have two networks from coLinux, make sure that the default gateway points to the network that has contact with the outside world! (check with route, or netstat -rn)
 
To add a default specifically for this network (e.g., if you wish to bridge it), the following might work:
 
 
<pre><nowiki>
 
(route add -net 192.168.37.0 gw eth0 OR)
 
route add -net 192.168.37.0 netmask 255.255.255.0 dev eth0
 
route add default gw 192.168.37.10
 
</nowiki></pre>
 
 
For Gentoo, try adding a line to /etc/conf.d/net that is like the following:
 
 
<pre><nowiki>
 
gateway="eth0/192.168.37.0"
 
</nowiki></pre>
 
 
*Set the Display
 
 
<pre><nowiki>
 
$export DISPLAY=192.168.37.10:0
 
</nowiki></pre>
 
   
 
== TAP with Windows Internet Connection Sharing ==
 
== TAP with Windows Internet Connection Sharing ==
Line 784: Line 600:
   
 
'''Note''': Using DHCP with Slirp, it is usually also necessary to add add nameservers. See [[Network#DNS Nameservers|DNS Nameservers]]
 
'''Note''': Using DHCP with Slirp, it is usually also necessary to add add nameservers. See [[Network#DNS Nameservers|DNS Nameservers]]
 
== Configuration ==
 
 
'''Debian''':
 
 
<pre><nowiki>
 
# file: /etc/network/interfaces
 
auto eth0
 
iface eth0 inet dhcp
 
</nowiki></pre>
 
 
'''Gentoo''':
 
 
<pre><nowiki>
 
# emerge dhcpcd
 
 
# nano /etc/conf.d/net
 
 
config_eth0=( "dhcp" )
 
</nowiki></pre>
 
 
Restart the network. See [[Network#Restarting_a_Network_Interface|Restarting a Network Interface]]
 
 
Check [http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2 Gentoo] webside for more informations.
 
   
 
= IP Address - Static =
 
= IP Address - Static =
Line 843: Line 635:
   
 
Add Nameservers. See [[Network#DNS Nameservers|DNS Nameservers]]
 
Add Nameservers. See [[Network#DNS Nameservers|DNS Nameservers]]
 
== Gentoo ==
 
 
The Gentoo image uses DHCP out of the box.
 
To change this to a static IP configuration, edit the text files /etc/resolv.conf and /etc/conf.d/net.
 
For the latter, comment out the line
 
 
Edit /etc/conf.d/net, so it looks like this:
 
 
<pre><nowiki>
 
#iface_eth0="dhcp"
 
iface_eth0="192.168.0.40 broadcast 192.168.0.255 netmask 255.255.255.0"
 
# gateway="eth0/192.168.0.1"
 
</nowiki></pre>
 
 
another suggested configuration is like this:
 
 
<pre><nowiki>
 
# nano /etc/conf.d/net
 
config_eth1=( "192.168.0.40 netmask 255.255.255.0" )
 
# routes_eth1=( "default gw 192.168.0.1" )
 
</nowiki></pre>
 
 
'''Example: Typical Configuration for Slirp'''
 
 
<pre><nowiki>
 
# nano /etc/conf.d/net
 
 
config_eth0=( "10.0.2.15 netmask 255.255.255.0 brd 10.0.2.255" )
 
routes_eth0=( "default gw 10.0.2.2" )
 
</nowiki></pre>
 
 
Check [http://www.gentoo.org/doc/en/handbook/handbook-x86.xml?part=1&chap=8#doc_chap2 Gentoo] webside for more informations.
 
 
Add Nameservers. See [[Network#DNS Nameservers|DNS Nameservers]]
 
 
As of 2005-11-9, ( and I assume much earlier also) the Gentoo default root_fs is called "Gentoo-colinux-stage3-x86-2004.3" The file /etc/conf.d/net in this root_fs already has the coLinux changes for IP address and gateway IP address, so you will not need to edit. In my case, this is the first point in the installaion where I might have needed to edit a Linux file (rather than a Windows file.) Fortunately, I remembered that the editor named "nano" is always available on a gentoo minimal system, so in the colinux comsole I issued the command "nano net" to begin editing the file.
 
   
 
= DNS Nameservers =
 
= DNS Nameservers =
Line 979: Line 734:
 
*"Completing the Network Setup Wizard": Follow the documentation links if you are interested, then click "Finish".
 
*"Completing the Network Setup Wizard": Follow the documentation links if you are interested, then click "Finish".
   
== Description 2 ==
 
 
'''On Windows XP:'''
 
 
<pre><nowiki>
 
Control Panel -> Network Connections -> Select the network adapter for sharing
 
-> Properties -> Tab Advanced -> Allow other network users...
 
-> Fill in name of the Home networking connection (the TAP-Win32 Adapter)
 
-> TAP-Win32 Adapter -> Ok.
 
</nowiki></pre>
 
 
* http://gniarf.nerim.net/colinux/1_networkconnection.gif
 
* http://gniarf.nerim.net/colinux/2_mainconnection.gif
 
* http://gniarf.nerim.net/colinux/3_tapproperties.gif
 
* http://gniarf.nerim.net/colinux/4_tapipsettings.gif
 
 
Internet Connection Sharing will only work with 192.168.0.1 being the IP address of the Tap device! Make sure that you do not assign a Gateway in the TAP IP settings (As shown above).
 
 
'''On Windows 2000:'''
 
 
<pre><nowiki>
 
Control Panel -> Network and Dial-UP Connections
 
-> Select the network adapter for sharing -> Properties -> Tab Sharing
 
-> Enable Internet Connection Sharing
 
-> Fill in name of the Home network (the TAP-Win32 Adapter)
 
-> TAP-Win32 Adapter -> Ok.
 
</nowiki></pre>
 
 
* There must be at least two _active_ connections on Window2000 before ICS can be enabled.
 
* If the NIC and TAP-Win32 are the only network adapters on the machine, coLinux will have to be started so that the "cable is connected" to the TAP-Win32 adapter, making it active.
 
* Then, ICS may be enabled on the NIC.
 
* Also, unless there are more than two adapters on the machine, there will be no place to enter the name of the Home network. Window2000 will assume that TAP-Win32 should be used.
 
 
* French version of Windows 2000, sorry, feel free to post your own :)
 
* http://gniarf.nerim.net/colinux/network1.gif
 
* http://gniarf.nerim.net/colinux/network2.gif
 
 
<hr>
 
 
== For AOL Dial-up ==
 
== For AOL Dial-up ==
   
Line 1,212: Line 929:
   
 
= Performance =
 
= Performance =
 
== Firewalls ==
 
 
A software firewall like [http://www.zonealarm.com/ ZoneAlarm] may impede performance, which will be particularly noticeable when running X applications. It might be useful to set up a private network for coLinux and the windows Host, and configure any firewall applications not to monitor that network.
 
   
 
== process priority ==
 
== process priority ==
Line 1,625: Line 1,338:
 
----
 
----
   
 
== Windows 2000 Asterisk BRIDGED config behind a Linksys router connected to the Internet ==
 
 
* Run the asterisk for windows installer
 
* In edit the astwind.colinux.xml file (make sure you arent editing the similar file - default.colinux.xml)
 
 
You should have the following line:
 
 
<pre><nowiki>
 
<network index='0' name='574' type='bridged'/>
 
</nowiki></pre>
 
 
* Contrary to other's instructions, the "name" above is NOT the name you gave to your LAN connection, it is also NOT the name found under Properties--&gt;"Connect using:"
 
 
* You can find the NIC adapter name that coLinux is looking for by watching the colinux boot window (you see this when you run astwind.bat) in the lines that begin with "bridged-net-daemon"... once you have found the name, you may type only a substring of it in the "name" field.
 
 
* In /etc/network/interfaces
 
 
Use DHCP if you have it enabled on your linksys box. Or, if you use a static IP, make sure you choose an unused address from the same subnet on which your windows box resides and use the ip address of the linksys as your gateway.
 
 
* In /etc/resolv.conf define the address of your ISPs DNS servers.
 
 
* Start astwind.cmd by double clicking (or running it from the command line).
 
 
* coLinux will now have a unique IP address and MAC address on the same subnet as your Windows2000 machine and your Linksys box (inside subnet).
 
 
If you used DHCP, you can see the address with '''ifconfig''' command.
 
 
* The TAP adapter will appear to be disconnected at all times, if this bothers you, go to its properties-&gt;click the "configure" button-&gt; advanced tab -&gt; and set the "media status" to always connected.
 
 
* The IP address assigned to the TAP adapter seems to be irrelevant in bridged mode.
 
 
I used 192.168.0.1 255.255.255.0 one time and 192.168.1.39 255.255.255.0 the next time.
 
   
 
= Accessing windows based VPN =
 
= Accessing windows based VPN =
Please note that all contributions to the coLinux are considered to be released under the CC-BY-SA
Cancel Editing help (opens in new window)