LinuxQuestions.org
Visit Jeremy's Blog.
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 03-22-2010, 07:13 AM   #1
zewolfen
LQ Newbie
 
Registered: Mar 2010
Posts: 12

Rep: Reputation: 0
Angry configure 2 nic's to share the internet


i am really bothered from this i cant configure the 2 nics to share the internet.... and i allready changed the sysctl.conf file to

# Controls IP packet forwarding
net.ipv4.ip_forward = 1

please help... i have one nic reeving the internet and working good and the other one cant see anything...
 
Old 03-22-2010, 07:48 AM   #2
nonamenobody
Member
 
Registered: Oct 2002
Posts: 138

Rep: Reputation: 22
Quote:
Originally Posted by zewolfen View Post
i am really bothered from this i cant configure the 2 nics to share the internet.... and i allready changed the sysctl.conf file to

# Controls IP packet forwarding
net.ipv4.ip_forward = 1

please help... i have one nic reeving the internet and working good and the other one cant see anything...
It isn't clear what you are trying to do. Assuming that you trying to share one computer's internet connection with other computer(s), you will need to do much more than merely enable ip forwarding. The following should give you an idea of the process - http://www.ubuntugeek.com/sharing-in...in-ubuntu.html

There may be GUI tools that can help you. The first that springs to mind is Firestarter.

Last edited by nonamenobody; 03-22-2010 at 07:57 AM. Reason: Forgot to mention Firestarter
 
Old 03-22-2010, 01:23 PM   #3
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Check out http://www.aboutdebian.com they have graphics and settings for creating virtual hosts on one NIC... i.e. 2 ip's both on one interface.
 
Old 03-22-2010, 01:37 PM   #4
frieza
Senior Member
 
Registered: Feb 2002
Location: harvard, il
Distribution: Ubuntu 11.4,DD-WRT micro plus ssh,lfs-6.6,Fedora 15,Fedora 16
Posts: 3,233

Rep: Reputation: 406Reputation: 406Reputation: 406Reputation: 406Reputation: 406
depends on what you mean, are you trying to
a) attach both nics to the internet simultaneously
or
b) one nic to the internet and one to a lan and share the connection?

the second option is much more useful and can be done using iptables or some gui firewall program like firestarter

the first would require nic bonding
http://www.cyberciti.biz/tips/linux-...interface.html but unless you had more then one modem/router it would more then likely be pointless since you wouldn't get any more performance then your modem allowed anyways

Last edited by frieza; 03-22-2010 at 01:40 PM.
 
Old 03-22-2010, 04:32 PM   #5
jefro
Moderator
 
Registered: Mar 2008
Posts: 21,976

Rep: Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623Reputation: 3623
The problem is that 2 nic's will not help most people. The rules of tcp/ip limit routes. Only one nic will end up being used.
 
Old 03-22-2010, 05:31 PM   #6
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Hi -

As nonamenobody, ericson007, and frieza all said, you can definitely have two NICs.

But exactly how to configure them ... depends completely on WHAT YOU WANT TO DO. And you haven't told us at all what your goal is.

As jefro said: if all you want to do is "access the Internet": you're probably better off just using one or the other NIC, and leaving the other one alone until you actually need it for something.

IMHO .. PSM
 
Old 03-23-2010, 08:39 AM   #7
zewolfen
LQ Newbie
 
Registered: Mar 2010
Posts: 12

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by frieza View Post
depends on what you mean, are you trying to
a) attach both nics to the internet simultaneously
or
b) one nic to the internet and one to a lan and share the connection?

the second option is much more useful and can be done using iptables or some gui firewall program like firestarter

the first would require nic bonding
http://www.cyberciti.biz/tips/linux-...interface.html but unless you had more then one modem/router it would more then likely be pointless since you wouldn't get any more performance then your modem allowed anyways


---yaaaah one nic to the internet and the other is connected to a switch to share the connection--- ...... the qustion is ? ? ? ? how to make the other nic shares the connection i am stuck in this issue for like 4 days with no solution but the 2 nic's can ping each other only
 
Old 03-23-2010, 08:49 AM   #8
zewolfen
LQ Newbie
 
Registered: Mar 2010
Posts: 12

Original Poster
Rep: Reputation: 0
i have 4 pcs one of them have a static ip and have two NIC cards connected to it,one NIC is connected to the internet and the other NIC connected to a switch that the other 3 pc's connected to.... now can anyone get me or get what i mean sorry for ma bad english
 
Old 03-23-2010, 10:28 AM   #9
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Ah - simple. "ip_forward" and iptables:

http://www.howtoforge.com/internet-c...ading-on-linux

http://www.ubuntugeek.com/sharing-in...in-ubuntu.html
<= This link was already suggested above...

http://www.howtoforge.com/home-gatew...haring-centos5

The specific details will vary depending on your distro, your LAN topology, and your preferences. But you should be able to get going with any of the above links.

'Hope that helps .. PSM
 
Old 03-27-2010, 11:28 AM   #10
zewolfen
LQ Newbie
 
Registered: Mar 2010
Posts: 12

Original Poster
Rep: Reputation: 0
okay thnx guys for your help.... now i have internet on the other pc's buti cant open any web site or ping to google....... but ican open skype or msn or stuff like that ...... i think i need to open the port 80 on the main pc that forward the connection.... but how to do that ? ?
 
Old 03-28-2010, 02:07 PM   #11
zewolfen
LQ Newbie
 
Registered: Mar 2010
Posts: 12

Original Poster
Rep: Reputation: 0
hello ?

hello ?
 
Old 04-20-2010, 03:58 AM   #12
ericson007
Member
 
Registered: Sep 2004
Location: Japan
Distribution: CentOS 7.1
Posts: 735

Rep: Reputation: 154Reputation: 154
Use something like firewall builder that will show you graphically which ports are allowed and denied, that sounds like your firewall setup.
 
Old 04-20-2010, 04:17 AM   #13
SuperJediWombat!
Member
 
Registered: Apr 2009
Location: Perth, Australia
Distribution: Ubuntu/CentOS
Posts: 208

Rep: Reputation: 51
If you want more help, run these commands and post the output to us:
iptables-save
ifconfig
route -n
cat /proc/sys/net/ipv4/ip_forward
 
  


Reply

Tags
internet, networking, sharing



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 3 nic's macdudeosx Linux - Networking 3 11-27-2008 01:15 PM
share internet connection - configure squid abailore Linux - Newbie 2 05-28-2008 03:01 PM
Two NIC's to share an Internet Conexion abenavar Linux - Networking 0 08-26-2007 10:57 AM
How to configure two NIC's properly in the server with RH 9.0 shamilson Linux - Networking 6 08-05-2006 01:24 AM
2 NIC's...No Internet phekno Linux - Networking 2 12-03-2003 11:49 PM

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

All times are GMT -5. The time now is 10:23 AM.

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