Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
09-09-2011, 01:18 PM
|
#1
|
Member
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90
Rep:
|
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
|
|
|
09-09-2011, 01:27 PM
|
#2
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529
|
|
|
|
09-09-2011, 01:30 PM
|
#3
|
Senior Member
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
|
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
|
|
|
09-09-2011, 01:35 PM
|
#4
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529
|
Not every body has a switch though.
Furthermore, you can use the linux box as firewall for the Windows box.
Kind regards
|
|
|
09-09-2011, 01:38 PM
|
#5
|
Senior Member
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,766
|
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...
|
|
|
09-09-2011, 01:47 PM
|
#6
|
Member
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90
Original Poster
Rep:
|
Quote:
Originally Posted by repo
|
I followed the post and did accordingly but it didn't work , I am still unable to share my internet.
|
|
|
09-09-2011, 01:50 PM
|
#7
|
Member
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90
Original Poster
Rep:
|
Quote:
Originally Posted by Thor_2.0
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.
|
|
|
09-09-2011, 01:51 PM
|
#8
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529
|
Do you use the correct nic for internal and external network?
Kind regards
|
|
|
09-09-2011, 01:58 PM
|
#9
|
Member
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90
Original Poster
Rep:
|
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
|
|
|
09-09-2011, 02:10 PM
|
#10
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529
|
Do you have a firewall running?
Try to flush the firewall before adding the rules
Can you ping the gateway from XP?
Perhaps this can help
http://www.howtoforge.com/nat_iptables
Kind regards
|
|
|
09-09-2011, 02:20 PM
|
#11
|
LQ Guru
Registered: May 2005
Location: boston, usa
Distribution: fedora-35
Posts: 5,325
|
|
|
|
09-09-2011, 04:11 PM
|
#12
|
Member
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90
Original Poster
Rep:
|
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
|
|
|
09-09-2011, 08:29 PM
|
#13
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529
|
|
|
1 members found this post helpful.
|
09-10-2011, 03:18 AM
|
#14
|
Member
Registered: Apr 2011
Distribution: OpenSuse 12.3 , Slackware 13.1 ; Centos 6.2 ; Fedora 14
Posts: 90
Original Poster
Rep:
|
Thanks a lot !
|
|
|
09-10-2011, 03:33 AM
|
#15
|
LQ 5k Club
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529
|
You're welcome.
Kind regards
|
|
|
All times are GMT -5. The time now is 06:11 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|