LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Internet Sharing Fedora 14 and Win XP (https://www.linuxquestions.org/questions/linux-networking-3/internet-sharing-fedora-14-and-win-xp-902177/)

Genocide_Hoax 09-09-2011 01:18 PM

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

repo 09-09-2011 01:27 PM

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

Kind regards

ButterflyMelissa 09-09-2011 01:30 PM

1 Attachment(s)
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 :D

Thor

repo 09-09-2011 01:35 PM

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

Kind regards

ButterflyMelissa 09-09-2011 01:38 PM

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...

:)

Genocide_Hoax 09-09-2011 01:47 PM

Quote:

Originally Posted by repo (Post 4467555)

I followed the post and did accordingly but it didn't work , I am still unable to share my internet.

Genocide_Hoax 09-09-2011 01:50 PM

Quote:

Originally Posted by Thor_2.0 (Post 4467559)
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 :D

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.

repo 09-09-2011 01:51 PM

Do you use the correct nic for internal and external network?

Kind regards

Genocide_Hoax 09-09-2011 01:58 PM

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 :(

repo 09-09-2011 02:10 PM

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

schneidz 09-09-2011 02:20 PM

this works for me:
http://www.linuxquestions.org/questi...6/#post3804866

Genocide_Hoax 09-09-2011 04:11 PM

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

repo 09-09-2011 08:29 PM

Quote:

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

Kind regards

Genocide_Hoax 09-10-2011 03:18 AM

Thanks a lot !

repo 09-10-2011 03:33 AM

You're welcome.

Kind regards


All times are GMT -5. The time now is 06:19 AM.