LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 11-07-2007, 03:22 AM   #1
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Rep: Reputation: 30
XP to Ubuntu ICS : file configuration query.


I have an XP machine which is connected to the internet. My Ubuntu 7.04 server ( no X-windows) is networked to the XP machine via a crossover patch cable. I can SSH to the Ubuntu fom XP using Putty.
What I wanted to do was to share my net connection with the Ubuntu machine, the subtle difference to usual ICS being that I want to Putty SSH into my Ubuntu box whilst it is sharing the connection and use wget and apt-get to download files and install / update software.
I'm slightly confused with the configuration side of things.

XP - Machine :
----------------
Network Connection Settings :

NIC (1) which is connected to the net :
Automatically obtains IP ADDRESS

NIC(2) which is connected to my Ubuntu box via xover cable :

IP Address : 192.168.0.1
Netmask 255.255.255.0
Default Gateway 192.168.0.1


Ubuntu Box :
---------------

/etc/network/interfaces :

#The primary network interface

auto etho
iface eth0 inet dhcp
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1


/etc/resolv.conf


nameserver 192.168.0.1

I am getting no connection but am I on the right track ? Could anyone see errors in my configuration or enlighten me on anything I have omitted.
Thanks again.

All good wishes,
Uncle-C
 
Old 11-07-2007, 06:04 AM   #2
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Original Poster
Rep: Reputation: 30
Just to update, I've ran ipconfig /all on the XP machine and I've found out that the NIC (1) which is connected to the net has been assigned IP of 192.168.0.2 with gateway /dns IP of 192.168.0.1. I was getting ICS errors due to IP addresses which had already been assigned.
So I've manually changed IP of NIC2 which connects to the linux box and changed the address in the Ubuntu /etc/network/interfaces to 192.168.0.10, but still no joy.
I know that ICS changes the IP of the machine whose connection you want to share to 192.168.0.1 so I fear my setup may not be possible ?
 
Old 11-07-2007, 06:11 AM   #3
mikasi
LQ Newbie
 
Registered: Mar 2006
Location: Ptuj, Slovenia
Posts: 11

Rep: Reputation: 0
Think of NIC as a separate LAN segmet. So the NIC(1) represents LAN segment 1 and NIC(2) represents LAN segment 2.
If you want to access from Ubuntu Box to the internet through XP machine you will have to enable switching between these two LAN segments.
On Windows XP that can be done by establishing a network bridge between these two NICs. Look at http://www.microsoft.com/resources/d...e_install.mspx to see how this is done.
When network bridge is created you will have to configure it like an ordinary NIC interface (automatic or dynamic IP address, automatic or dynamic DNS, etc.).
Now all the traffic from NIC1 will be switched to NIC2 and vice versa (when necessary).

When this is done you should be able to access to the internet from both machines and of course be able to communicate between the machines.

P.S.
Make sure that IP addresses of all NICs are in the same network and have the same network mask!

Regards, mikasi

Last edited by mikasi; 11-07-2007 at 06:14 AM.
 
Old 11-07-2007, 07:16 AM   #4
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Original Poster
Rep: Reputation: 30
Thank you Mikasi,
This is form the link you recommended.

Adapters that have Internet Connection Sharing (ICS) or Internet Connection Firewall (ICF) enabled cannot be part of the network bridge and will not appear on the Network Bridge checklist. Similarly, the Add to Bridge menu command is available only for adapters that you can add as connections to Network Bridge.

So I assume in my case ( as I want ICS to my Ubuntu from XP) this is not valid ?

Uncle
 
Old 11-07-2007, 10:50 AM   #5
mikasi
LQ Newbie
 
Registered: Mar 2006
Location: Ptuj, Slovenia
Posts: 11

Rep: Reputation: 0
It is (probably) true that bridged NICs as such cannot be part of ICS an ICF but "Bridge NIC" can be firewall ed. In this type of configuration you do not have to worry about ICS anymore. All you have to do is to configure "Bridge NIC" as I mentioned before.
I have the same computer configuration (one Linux and one windows XP) like you and I successfully solved the same problem some time ago.

Take a look at my configuration:
- Network Connections http://img137.imageshack.us/img137/3194/net01ga8.gif
- Network Bridge properties http://img100.imageshack.us/img100/1295/net02hr9.gif
- "ipconfig -all" output http://img266.imageshack.us/img266/4760/net03zw1.gif
 
Old 11-07-2007, 11:02 AM   #6
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Original Poster
Rep: Reputation: 30
Thank you very much mikasi. I tried to use your method but it did not work.
I think I may have configured the linux box incorrectly.
Do I have to make special alterations to any linux config files ? ie. alter the nameserver in resolv.conf or set the box to dhcp ?

I really need a connection to my linux box so I can use apt-get to install software an dhave been trying desperately for days.

I will give it another go !

Thanks again !

Uncle.
 
Old 11-07-2007, 11:26 AM   #7
mikasi
LQ Newbie
 
Registered: Mar 2006
Location: Ptuj, Slovenia
Posts: 11

Rep: Reputation: 0
Have in mind that by creating network bridge on your windows machine you actually created 2 port switch with your PC !
Regarding IP settings you have to configure your Linux NIC similar to your windows NIC. If that means automatic (using DHCP) retrieval of your IP address, default gateway address and network mask (and probably DNS address too) on your windows machine then that is the case for your Linux machine too.
I just hope that your internet provider supports retrieval of two IP addresses! This is not a concern if you are using external router or something similar, because "real" connection is done by router itself (if everything is correctly configured on router...).

1.) First make sure that in configuration I described you can ping Linux box from Windows XP and vice versa. if OK go on...
2.) Ping default gateway (look at your ipconfig -all command on your windows machine) from both boxes. if OK go on...
3.) Make sure you have DNS configured. Try to ping DNS address from both machines. if OK go on...
4.) If you reached this far then it should work.

How far do you get?



Please try to describe you network configuration...
- Cable, ADSL, VDSL...
- dynamic IP I guess or static IP...
- external router attached to modem or direct connection to modem...

Last edited by mikasi; 11-07-2007 at 11:41 AM.
 
Old 11-07-2007, 11:48 AM   #8
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Original Poster
Rep: Reputation: 30
Thank you so much, I have set up a bridge and now I can use the net on XP and Putty SSH to into my Linux box at the same time, but no net on linux.
I am using AOL ADSL, unfortunately. They give me a dynamic IP and the IPs of the DNS servers change each time I login in.
Will get screenshots etc of all data in my next post. Thanks.

Last edited by uncle-c; 11-07-2007 at 11:53 AM.
 
Old 11-07-2007, 12:45 PM   #9
mikasi
LQ Newbie
 
Registered: Mar 2006
Location: Ptuj, Slovenia
Posts: 11

Rep: Reputation: 0
In my configuration I am using router connected to ADSL modem. That means that router is the one that actually makes connection to my ISP and that DHCP request from my Linux and Windows boxes are handled by router and not ISP provider! That means that IP addresses leased to Linux and Windows machines by router DHCP server are in the same network. Additionally this network addresses are local and not public. In this configuration local machines do not need to use DHCP.

If you are not using router then at least two problems can occur:
- your Linux and Windows box will have different IP addresses in different networks (machines will not be able to see each other)
- your Linux and Windows box will have different IP addresses in the same network (the machines will be able to see each other but...). On your windows box you will not know which IP address Linux box retrieved and vice versa. That means that theoretically you could make a connection between bachines but in a given time you do not know the leased address to the other machine!.

Firewall should be disabled on both boxes for this type of connection to work ... and this is not acceptable...

Damn ... maybe we will have to figure out something else...
I will look into some other possible solutions.

P.S.
It is so much easier if external router is used.
 
Old 11-07-2007, 12:55 PM   #10
mikasi
LQ Newbie
 
Registered: Mar 2006
Location: Ptuj, Slovenia
Posts: 11

Rep: Reputation: 0
Yeah! I think I figured out how it can be done! On one physical NIC card on Linux box you could configure two logical Ethernet interfaces. One logical interface can retrieve IP address dynamically from AOL while the other logical interface has static local IP address used for communication on local network (to Windows). The same should be done on windows box. That way static local IP addresses on both boxes are used for communication between them while dynamically retrieved IP addresses are used for internet access only!

I hope my theory holds up!

Please put here "ipconfig -all" command output....

P.S.
If you want you can contact me via Skype. I hope I will have some more time today but if not do not hesitate to contact me tomorrow.

Last edited by mikasi; 11-07-2007 at 01:00 PM.
 
Old 11-07-2007, 01:27 PM   #11
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Original Poster
Rep: Reputation: 30
I am indebted mikasi. Here is all the info I have.

My Linux Box :

/etc/resolv.conf

server home
nameserver 192.168.0.1


/etc/network/interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The home network interface

auto eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0


ipconfig output when not connected to the Internet :

http://i24.tinypic.com/fbwepg.jpg

Can ping from Linux (192.168.0.10) to XP and visa versa ( only when firewall disabled on XP). Can Putty SSH into Linux fom XP ( even when firewall enabled)

ipconfig output when connected to the Internet :

http://i22.tinypic.com/259ik4l.jpg

Firewall output :

http://i20.tinypic.com/1zlvq0l.jpg

Can only ping into XP when firewall disabled. Can ping form XP to Linux. Can Putty SSH into Linux !

Just as an aside I cannot get an IP assigned to my Linux when I use DHCP and the bridging network method.

Thanks again I hope there is a solution to this.

uncle
 
Old 11-08-2007, 01:40 AM   #12
mikasi
LQ Newbie
 
Registered: Mar 2006
Location: Ptuj, Slovenia
Posts: 11

Rep: Reputation: 0
Aha...

Now I have slightly better picture of your network.

Your Windows XP "Network Connections" now contains:
- one broadband interface (AOL ppp connection)
- one bridge interface (bridging NIC 1 and NIC 2)

What you have to do:
====================
- configure bridge interface to have static IP address, network mask, no default gateway and no DNS address.
for example:
IP address: 192.168.0.5
Network mask: 255.255.255.0
http://img258.imageshack.us/img258/1944/pic01jw4.gif

- configure your AOL interface to automatically retrieve IP address and other information (you already have that)
http://img205.imageshack.us/img205/2354/pic02xj2.gif

- enable ICS on your AOL interface and chose bridge interface from the "Home networking connections" list.
http://img106.imageshack.us/img106/5061/pic03ph8.gif

- configure interface on your Linux machine to have static IP address, network mask, default gateway pointing to your windows machine and DNS address also pointing to your windows machine.
for example:
IP address: 192.168.0.10
Network mask: 255.255.255.0
Default gateway: 192.168.0.5
DNS address: 192.168.0.5



Once more test connections with ping like before. Tell me how far you get.

I hope this will work. If it doesn't we will investigate further. Currently I am at my office and I can't test this configuration.

P.S.
While playing with all these configurations disable firewall on windows and Linux (probably firewall is not configured on your linux box). We will get to the firewall configuration later.

Last edited by mikasi; 11-08-2007 at 02:07 AM.
 
Old 11-08-2007, 08:28 AM   #13
uncle-c
Member
 
Registered: Oct 2006
Location: The Ether
Distribution: Ubuntu 16.04.7 LTS, Kali, MX Linux with i3WM
Posts: 299

Original Poster
Rep: Reputation: 30
Good afternoon mikasi,
Firstly many thanks for all your kind help. I apologise for taking so much of your valuable time.
Well, I tried to do as you have outlined. Here are the results.

In OFFLINE mode:

IP of Linux = 192.168.0.10

I rebridged the two NICS and this time the Bridge was assigned IP 192.168.0.2
I checked this using ipconfig /all

http://i14.tinypic.com/717newk.jpg

So I went into Bridge Properties and made the following adjustments :

STATIC IP : 192.168.0.2
NETWORK MASK : 255.255.255.0
No default Gateway or DNS.


I edited the relative Linux files to reflect this change.

$ cat etc/resolv.conf

server home
nameserver 192.168.0.2


$ cat /etc/network interfaces

# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The home network interface

auto eth0
iface eth0 inet static
address 192.168.0.10
netmask 255.255.255.0
gateway 192.168.0.2



From the Linux box ( 192.168.0.10) I can ping ( when the firewall is disabled) to 192.168.0.2 AND
192.168.0.1. May I ask what 192.168.0.1 is ??? Needless to say that when the firewall is enabled I cannot ping to either IP. I can still Putty SSH into Linux from XP when firewall is enabled and disabled.


In ONLINE mode :



Now connect to Internet. (firewall ON)




The AOL interface only comes up on my "NETWORK CONNECTIONS" window when I run the software to get online and log in.


Here is the "NETWORK CONNECTIONS" window when I am online :

http://i19.tinypic.com/6kjr1wy.jpg


Now to "INTERNET CONNECTION SHARE."

When I want to ICS the following window comes up, but notice that I am not given the option to share with neither the "Bridge" or any other network. What could be possible reasons ?

http://i14.tinypic.com/85aaki1.jpg

Anyway I did click "Allow other users to connect through this computer's Internet connection" and Microsoft automatically assigned the IP 192.168.0.1 to the Bridge.

http://i8.tinypic.com/8f1u03m.jpg

Cannot Ping to 192.168.0.2 but can to 192.168.0.1 from Linux

Here is ipconfig /all output after "ICS"

http://i13.tinypic.com/8b9qg41.jpg

So I had to make changes in my linux files ( /etc/resolv.conf and /etc/network/interfaces) replacing 192.168.0.2 with 192.168.0.1. Changing DNS and Gateway to 192.168.0.1.
From Linux can ping to 192.168.0.1 but not to 192.168.0.2.
Can still surf net on XP and connect to Linux via SSH.
When I open "NETWORK CONNECTIONS" and look at Bridge properties and IP has been set to 192.168.0.1

http://i13.tinypic.com/6p5lu76.jpg

Disabling Firewall :

Can now ping remote server and ftp from Linux box !!!!!! Success of sorts !!

Here is a synopsis of what has been done so far :

1. Bridge the two NICS/LANS
2. Do "Internet Connection Sharing" from the main "dial in" (AOL) adapter to the rest of the network. This will automatically set the IP of the Bridge to 192.168.0.1. No networks were seen in my case but I still checked the box.
3. Edit the various Linux files. DNS / Default Gateway both to 192.168.0.1 ( Restart networking).
4. Disable the XP firewall. This is the only way to connect the Linux box to the internet.
5. Could ping / ftp to remote server and Putty SHH from XP into Linux.

The drawbacks have been that the firewall on XP has to be disabled for the Linux connection to work. I use Zone Alarm (free version) and I do not think the free version will allow me to adjust incoming / outgoing connections from 192.168.0.10. Could this hurdle be overcome as security is essential on my linux and xp boxes ? Secondly, as soon as I disconnect from the net I lose the "Connection Sharing" so have to repeat the procedure.
But mikasi thank you so so much. I am indebted to you for your kind help.
Do you think the remaining minor problems can be overcome ?

Thanks again and best wishes,
Uncle-C

Last edited by uncle-c; 11-08-2007 at 11:20 AM.
 
Old 11-08-2007, 11:50 AM   #14
mikasi
LQ Newbie
 
Registered: Mar 2006
Location: Ptuj, Slovenia
Posts: 11

Rep: Reputation: 0
I'm really pleased that it works!

And yes, it is possible to resolve remaining minor problems.

1.)
It is normal that when you disconnect from the internet on your windows machine (AOL connection) you will also lose internet connection on the Linux machine too. There are methods to dynamically connect and disconnect such connection as needed but that is another story....
Are you trying to say that you have to configure ICS on AOL interface again when you disconnect from internet?!?

2.)
I will try to explain what needs to be done (refer to the the picture http://img442.imageshack.us/img442/971/ics01uq8.gif).

Your Linux and Windows machines are locally connected together which represents LAN (local area network). At the same time your windows machine is connected to the Internet or WAN (wide area network). Of course Linux machine is also connected to the internet via windows machine which acts as a internet gateway for Linux box.
Usually LAN network is treated as "trusted" network, while WAN is definitely not.

Every firewall that deserves it's name can be configured in such a way that specific firewall rules apply to specific interface. Zone Alarm (free version too) definitely is such firewall.
You have to configure Zone Alarm in a way that it will allow all traffic to and from network 192.168.0.0 on "Network Bridge" interface (if that is not possible apply those rules to both NICs). On the other hand you have to configure Zone Alarm to restrict connections from AOL interface (allow only output connections for internet use only).

I'm not really familiar with Zone Alarm because I am using some other solution but I am 100% sure that this can be done in Zone Alarm!

If you will have problems configuring the firewall I can install Zone Alarm on one of my virtual machines and try to guide you through the configuration process.


P.S.
Yeah, I forgot that windows are stupid enough that when you enable ICS they force you to have local IP address 192.168.0.1.

Last edited by mikasi; 11-08-2007 at 12:01 PM.
 
Old 11-08-2007, 12:47 PM   #15
mikasi
LQ Newbie
 
Registered: Mar 2006
Location: Ptuj, Slovenia
Posts: 11

Rep: Reputation: 0
Now I understand... you are using AOL special software to connect to the internet. When you are connecting to the internet this software actually creates "The Internet" interface and when you disconnect from the internet it destroys it. That is why your ICS configuration is lost!

The simplest solution is NOT to use AOL software but configure your own broadband interface on your Windows machine.

How to do this? Easy... follow the pictures...
1.) Create new connection http://img75.imageshack.us/img75/6083/con01hi8.gif
2.) Next http://img144.imageshack.us/img144/8189/con02zl3.gif
3.) "Connect to the Internet" http://img223.imageshack.us/img223/3176/con03vi5.gif
4.) "Setup connection manually" http://img86.imageshack.us/img86/4981/con04vw5.gif
5.) "Connect using Broadband..." http://img212.imageshack.us/img212/2063/con05pc8.gif
6.) Enter ISP name (any name as you wish) http://img222.imageshack.us/img222/3376/con06cf3.png
7.) Enter username and password that was provided by AOL http://img250.imageshack.us/img250/1803/con07tg3.png
8.) Finish http://img485.imageshack.us/img485/218/con08qq3.gif
9.) You can try to connect now... http://img231.imageshack.us/img231/7483/con09tm6.gif
10.) Don't forget to configure ICS on your newly created Broadband connection http://img101.imageshack.us/img101/4813/con10bt7.gif
11.) Configuring ICS on your Broadband connection http://img138.imageshack.us/img138/4093/con11az0.gif

Now you can connect and disconnect you broadband interface without using AOL software. This Broadband connection will not disappear from your "Newtwork Connections" when you disconnect from the internet.

Last edited by mikasi; 11-08-2007 at 01:11 PM.
 
  


Reply

Tags
adsl, connection, internet, modem, sharing, ubuntu, xp



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Sharing an XP net connection with a Ubuntu box - Ubuntu config query. uncle-c Linux - Newbie 2 11-06-2007 10:09 AM
Which linux OS (Ubuntu/Suse) is best for ICS & networking ? quarks Linux - Networking 1 07-31-2007 02:08 AM
ics between winxp pro & ubuntu 7.04 feisty linuxnewbie01 Linux - Networking 0 05-16-2007 11:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:37 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration