LinuxQuestions.org
Review your favorite Linux distribution.
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 09-09-2011, 01:18 PM   #1
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Rep: Reputation: 8
Internet Sharing Fedora 14 and Win XP


Hello Everyone ,


I am trying to share my internet connection using two NICs in my fedora 14 machine. My eth1 connects me to the internet and my eth0 connects me to my windows machine. Below is the snapshot of my ifconfig. I am being able to ping my windows machine from my linux and vise- versa but I am not sure as to what do I have to do to bridge the two network cards.

Code:
[root@rubolzz network-scripts]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:21:91:22:23:33  
          inet addr:192.168.0.1  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::221:91ff:fe22:2333/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1606 errors:0 dropped:2638832310 overruns:0 frame:2638963380
          TX packets:1645 errors:12 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:146954 (143.5 KiB)  TX bytes:158777 (155.0 KiB)
          Interrupt:19 Base address:0xcc00 

eth1      Link encap:Ethernet  HWaddr 00:26:18:BC:C6:70  
          inet addr:172.16.10.172  Bcast:172.16.255.255  Mask:255.255.0.0
          inet6 addr: fe80::226:18ff:febc:c670/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:50544 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6650 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:6538370 (6.2 MiB)  TX bytes:882595 (861.9 KiB)
          Interrupt:43 Base address:0xe000 

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:467 errors:0 dropped:0 overruns:0 frame:0
          TX packets:467 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:42712 (41.7 KiB)  TX bytes:42712 (41.7 KiB)
The windows machine nic has the following ip setup

IP : 192.168.0.2
Subnet Mask : 255.255.255.0
Default Gateway : 192.168.0.1

I would be very grateful if someone can guide me through the process. I suppose I'll have to use the route command. I tried changing the setting of my eth1 card to "Shared to Other Computer" but it didnt work .

Regards

P.S : I m using Windows XP Home Edition
 
Old 09-09-2011, 01:27 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Take a look, at
http://www.revsys.com/writings/quicktips/nat.html

Kind regards
 
Old 09-09-2011, 01:30 PM   #3
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Hi,

Stop making things difficult...there's an easy way around this ...

Look at the attached scetch. Set things up like this and you're set.

You need a switch in the works. Give each box a static IP and set the IP of the modem as default gateway, for the Linux box

Quote:
route add default gw 192.168.1.1
assuming 192.168.1.1 is the IP of the modem...

I'll keep this thread on the scope

Thor
Attached Thumbnails
Click image for larger version

Name:	LAN01.jpg
Views:	20
Size:	11.6 KB
ID:	7962  
 
Old 09-09-2011, 01:35 PM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Not every body has a switch though.
Furthermore, you can use the linux box as firewall for the Windows box.

Kind regards
 
Old 09-09-2011, 01:38 PM   #5
ButterflyMelissa
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
Blog Entries: 23

Rep: Reputation: 411Reputation: 411Reputation: 411Reputation: 411Reputation: 411
Quote:
Furthermore, you can use the linux box as firewall for the Windows box.
Touché...and, I have to make a point of not assuming everyone has a private LAN...sorry...

 
Old 09-09-2011, 01:47 PM   #6
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by repo View Post
I followed the post and did accordingly but it didn't work , I am still unable to share my internet.
 
Old 09-09-2011, 01:50 PM   #7
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
Quote:
Originally Posted by Thor_2.0 View Post
Hi,

Stop making things difficult...there's an easy way around this ...

Look at the attached scetch. Set things up like this and you're set.

You need a switch in the works. Give each box a static IP and set the IP of the modem as default gateway, for the Linux box



assuming 192.168.1.1 is the IP of the modem...

I'll keep this thread on the scope

Thor

I don't have a modem. its a direct wired connection , I mean a rg45 feeds directly to my machine and I connect to a local gateway for my connection.
 
Old 09-09-2011, 01:51 PM   #8
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Do you use the correct nic for internal and external network?

Kind regards
 
Old 09-09-2011, 01:58 PM   #9
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
Yes , my internal network on eth0 and external network on eth1. And in the example, the internal network was on eth1 and the external network was on eth0 , so just swapped all the eth0 with eth1 n visa-versa . But all in vain
 
Old 09-09-2011, 02:10 PM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Do you have a firewall running?
Try to flush the firewall before adding the rules
Code:
iptables -F
Can you ping the gateway from XP?
Perhaps this can help
http://www.howtoforge.com/nat_iptables

Kind regards
 
Old 09-09-2011, 02:20 PM   #11
schneidz
LQ Guru
 
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,313

Rep: Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918Reputation: 918
this works for me:
http://www.linuxquestions.org/questi...6/#post3804866
 
Old 09-09-2011, 04:11 PM   #12
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
Thank you everyone for your prompt replies especially repo your post did the trick for me. I flushed my iptables and ran the commands again and I was able to ping my internet gateway from my windows machine. The only additional thing I had to do which I am mentioning for future reference for someone in need is , I had to add my internet dns ip in my windows machine. Thanks a lot everyone . And repo I did what the post told me to do but I didn't understand some parts of it like in the command

Code:
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
What does MASQUERADE mean?

Will that be possible for to provide me a reference as to what these commands signify. Yes, I do understand that I am forwarding all the request from eth1 to eth0 and eth1 is responding to each request by natting my external IP to a local IP , but I am not very much clear with this. Can you please help me understand the commands for my learning purpose.

Thank You

Regards

Last edited by Genocide_Hoax; 09-09-2011 at 04:13 PM. Reason: mistyping
 
Old 09-09-2011, 08:29 PM   #13
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
What does MASQUERADE mean?
http://linux.about.com/od/lna_guide/a/gdelna91.htm

Kind regards
 
1 members found this post helpful.
Old 09-10-2011, 03:18 AM   #14
Genocide_Hoax
Member
 
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90

Original Poster
Rep: Reputation: 8
Thanks a lot !
 
Old 09-10-2011, 03:33 AM   #15
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
You're welcome.

Kind regards
 
  


Reply



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 internet with win xp Zeusz3 Linux - Networking 5 04-22-2009 11:22 AM
Internet connection sharing win - linux? ak-87 Linux - Networking 14 05-13-2007 05:48 AM
Sharing internet between WIN XP and REDHAT Travis Huey Linux - Newbie 10 02-14-2005 01:11 AM
internet sharing from slack 10.0 -> win xp zobra Linux - Networking 4 11-20-2004 12:17 AM
Sharing Internet Connection with Win Me iaypaa Linux - Networking 8 10-13-2002 04:52 PM

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

All times are GMT -5. The time now is 04:22 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