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 09-15-2009, 05:36 AM   #1
vijaya_svk
Member
 
Registered: Nov 2007
Posts: 61

Rep: Reputation: 15
How to share the internet on two interfaces


Hi
I am using fedora 11 on my system and it is having 2 NIC's, eth0 and eth1. I have internet connection connected to eth0 and i want to share internet to other PC whose NIC is connected to eth1.

How can i route this? Please help me with the routing table code.
 
Old 09-15-2009, 08:30 AM   #2
estabroo
Senior Member
 
Registered: Jun 2008
Distribution: debian, ubuntu, sidux
Posts: 1,126
Blog Entries: 2

Rep: Reputation: 124Reputation: 124
turn on forwarding (echo 1 > /proc/sys/net/ipv4/ip_forward) usually can be done permanently in sysctl.conf

add a masquerade rule, something like iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE

then put a route rule on the other PCs to send internet traffic that pc, typically a default route, like route add default gw ip.of.gateway.pc
 
  


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
share internet from xp,use the share internet on fc11 z99 Linux - Newbie 5 08-13-2009 03:44 PM
switching between interfaces to use to access internet...the slackware way Tux-Slack Slackware 8 11-14-2007 03:12 PM
Internet Connection issue with 2 Network interfaces Andrea_44 Ubuntu 1 10-05-2006 03:08 PM
Qos,router with 2 interfaces (lan+internet) problem Dimitris_Papadakis Linux - Networking 0 02-02-2006 09:21 AM
Two eth interfaces, but one only with internet... Creak Linux - Networking 6 03-12-2005 01:52 AM

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

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