LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (http://www.linuxquestions.org/questions/linux-networking-3/)
-   -   configure 2 nic's to share the internet (http://www.linuxquestions.org/questions/linux-networking-3/configure-2-nics-to-share-the-internet-797036/)

zewolfen 03-22-2010 08:13 AM

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

nonamenobody 03-22-2010 08:48 AM

Quote:

Originally Posted by zewolfen (Post 3907457)
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.

ericson007 03-22-2010 02:23 PM

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.

frieza 03-22-2010 02:37 PM

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

jefro 03-22-2010 05:32 PM

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.

paulsm4 03-22-2010 06:31 PM

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

zewolfen 03-23-2010 09:39 AM

Quote:

Originally Posted by frieza (Post 3907810)
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

zewolfen 03-23-2010 09:49 AM

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 :D or get what i mean sorry for ma bad english :D :D :D :Pengy:

paulsm4 03-23-2010 11:28 AM

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

zewolfen 03-27-2010 12:28 PM

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 ? ?:Pengy:

zewolfen 03-28-2010 03:07 PM

hello ?
 
hello ?

ericson007 04-20-2010 04:58 AM

Use something like firewall builder that will show you graphically which ports are allowed and denied, that sounds like your firewall setup.

SuperJediWombat! 04-20-2010 05:17 AM

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


All times are GMT -5. The time now is 11:42 PM.