LinuxQuestions.org
Help answer threads with 0 replies.
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-12-2004, 07:48 AM   #1
tekbuz
LQ Newbie
 
Registered: Aug 2004
Location: london
Distribution: debian
Posts: 7

Rep: Reputation: 0
Question dual network card


I just got the broadband and i like to make a home network. The think is i was planing to do by two network card but when ever i set from interfaces i lost internet connection. in eth0 with auto dhcp broadband working fine. Can anyone tell me how am i gonna connect the other computers. Thanks!
 
Old 09-12-2004, 09:32 AM   #2
HappyTux
Senior Member
 
Registered: Mar 2003
Location: Nova Scotia, Canada
Distribution: Debian AMD64
Posts: 4,170

Rep: Reputation: 244Reputation: 244Reputation: 244
Re: dual network card

Quote:
Originally posted by tekbuz
I just got the broadband and i like to make a home network. The think is i was planing to do by two network card but when ever i set from interfaces i lost internet connection. in eth0 with auto dhcp broadband working fine. Can anyone tell me how am i gonna connect the other computers. Thanks!
The file /etc/network/interfaces is where your settings for the card are it should contain something like this for it to work and this assumes that you have the cable from the second card in the machine eth1 going into a hub/switch/router that the other machines on the network are connecting into.

Code:
 # /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

 # The loopback interface
 auto lo
 iface lo inet loopback

 # The first network card - this entry was created during the Debian installation
 # (network, broadcast and gateway are optional)
 auto eth0 eth1
 iface eth0 inet dhcp

 iface eth1 inet static
         address 192.168.0.254
         netmask 255.255.255.0
         network 192.168.0.0
         broadcast 192.168.0.255
Now you need an iptables script to do the forwarding/firewalling for the machines I use Arno's IPTABLES you download the script to the machine and set it up as follows.

1. Copy the rc.iptables to /etc/init.d/ directory and change the permissions chmod 0700 /etc/init.d/rc.iptables.

2. Create the link to start the script on boot I used update-rc.d rc.iptables defaults or you can use the recommended ln -s /etc/init.d/rc.iptables /etc/rcS.d/S99iptables in the help/installation instructions at the site both start the script on boot.

3. Now you copy the configuration file to /etc/iptables-firewall.conf and change the settings for your setup. In this section change the EXT_IF_DHCP_IP=0 to EXT_IF_DHCP_IP=1 to tell it you get the address with DHCP.
Code:
IPTABLES="/sbin/iptables"         # Location of the iptables-binary (use 'locate
 iptables' or 'whereis iptables'
                                  # to manually locate it).
EXT_IF="eth0"                     # The external interface that will be protecte
d (and used as internet connection)
                                  # This is probably ppp+ for (A)DSL (for non-tr
ansparent (A)DSL routers!)
                                  # otherwise it should be "ethX" (ex. eth0)
EXT_IF_DHCP_IP=0                  # Enable if THIS machines (dynamically) obtain
s its IP through DHCP (from your ISP)
And here you change the internal interface to the static settings using these settings which allows you to use IP's for the machines on your network in the ranges 192.168.0.1-192.168.0.253 .
Code:
#####################################
# LAN & NAT (masquerading) settings #
#####################################
INT_IF="eth1"                     # Internal network interface or interfaces (mu
ltiple(!) interfaces should be
                                  # space seperated). Remark this if you don't h
ave any internal network interfaces.
INTERNAL_NET="192.168.0.0/24"     # Your internal subnet which is connected to t
he internal interface (INT_IF. For
                                  # multiple interfaces(!) you can either specif
y multiple subnets here or specify one
                                  # big subnet for all internal interfaces. Note
 that packets from these subnets are always
                                  # accepted!
NAT=1                             # Enable this if you want to perform NAT for y
our internal network (LAN)
                                  # (ie, share your internet connection with you
r internal net(s) connected to INT_IF)
The NAT=1 as the comments tell you allow you to share the connection.

4. Now you change the permissions again so only root can see the settings file chmod 0600 /etc/iptables-firewall.conf .

5.Restart the networking so you can set the IP for eth1 /etc/init.d/networking restart and start the firewall/NAT so you can use the connection sharing /etc/init.d/rc.iptables start.

Now the machines on your internal network use settings like this to enable them to connect to the network.

Code:
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0


iface eth0 inet static
        address 192.168.0.1
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.254
And you would need to set the nameservers in the /etc/resolv.conf.
Code:
 search wolf
 nameserver 192.168.1.10
 nameserver 192.168.1.34
You only need the one nameserver line the search of your domain is optional depending on your ISP's settings that they gave you and the extra nameserver is not necessary but good to have in case your primary goes down.

BTW if you want to use IRC then change in the General settings of the config file USE_IRC=0 to USE_IRC=1.
 
  


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
linux shuts down built in network card then windows tells me network card is unplugge lesmoxhaybaker SUSE / openSUSE 8 08-29-2006 05:10 PM
Install network card Intel PRO/1000 MT Dual Servers adapter Alex_Saf Fedora 3 03-17-2005 11:30 AM
Dual PIII 866 network card problem designlogic Linux - Hardware 1 02-20-2005 03:00 AM
Dual network card problem ccjsmith Linux - Networking 1 02-28-2004 11:00 AM
Dual Network Card in RH7.3 dkny01 Linux - Networking 16 10-08-2003 01:34 AM

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

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