Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> How Do I Set A 2nd Ethernet Card?, and I mean the very basic settings...
socratesabroad
post May 16 2004, 07:26 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 16-May 04
Member No.: 2,974



I have a question about a second Ethernet card in a Linux PC.

I have a win2k PC and linux machine running together on a physical router connected to an ADSL (PPOE) line. I installed Turbolinux 10.0 DSKTP on a self-built PC - the first ethernet card (eth0: Intel Pro/1000 CT, on-board) was recognized and I'm on the net now. Now, I want to use a second card (eth1: I-O Data ETX-PCI aka Realtek 8139) to connect to my win2k machine or whatever else is on my home LAN.

Unless someone convinces me otherwise, here's what I want to do:

Linux PC <--> WinPC
___|__________|___
router
___|___
ADSL modem

where <--> is the connection I want to make using eth1.

The problem is that I don't know how (i.e., what settings to enter) to set the second card, so I can't get it to run. Assuming I use a host name (curtjpn in my case), do I need to assign a domain name even if I just want to run the linux PC in tandem with the win2k PC? And what about the 'gateway device' and 'gateway address'? Do I need to create a new host in the 'host list'?

If these questions seem too basic, please feel free to point me in the direction of somewhere for novices like me.

I apologize for the long post but would appreciate any help I can get...

/sbin/ifconfig -a
eth0 Link encap:Ethernet HWaddr 00:20:ED:61:72:1C
inet addr:192.168.1.101 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:53436 errors:0 dropped:0 overruns:0 frame:0
TX packets:52252 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:74707630 (71.2 Mb) TX bytes:3999585 (3.8 Mb)
Interrupt:20 Base address:0xa800 Memory:e1002000-e1002038

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:13228 errors:0 dropped:0 overruns:0 frame:0
TX packets:13228 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1417983 (1.3 Mb) TX bytes:1417983 (1.3 Mb)

/sbin/route -en
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 192.168.1.1 0.0.0.0 UG 0 0 0 eth0

ifcfg eth0
DEVICE=eth0
IPADDR=0.0.0.0
ONBOOT=yes
BOOTPROTO=dhcp
MODE=Managed
ESSID=Any

ifcfg eth1
DEVICE=eth1
IPADDR=192.168.0.10
NETMASK=255.255.255.0
NETWORK=192.168.0.0
BROADCAST=192.168.0.255
ONBOOT=yes
BOOTPROTO=static
MODE=Managed
ESSID=Any

ifcfg lo
DEVICE=lo
IPADDR=127.0.0.1
NETMASK=255.0.0.0
NETWORK=127.0.0.0
# If you're having problems with gated making 127.0.0.0/8 a martian,
# you can change this to something else (255.255.255.255, for example)
BROADCAST=127.255.255.255
ONBOOT=yes
NAME=loopback
Go to the top of the page
 
+Quote Post
mchclay
post Jun 8 2004, 09:53 AM
Post #2


Whats this Lie-nix Thing?
*

Group: Members
Posts: 3
Joined: 8-June 04
Member No.: 3,118



If I am understanding you correctly you want to set up your linux box to router traffic from your windoze box out to the Internet. This is for Redhat Linux I am not sure if TurboLinux is the same. In order to do this you will need to assign an IP address to your secondary interface by editing this file:

/etc/sysconfig/network-scripts/ifcfg-eth1

It should look something like this:

DEVICE=eth1
BOOTPROTO=static
BROADCAST=172.16.2.255
IPADDR=172.16.2.1
NETMASK=255.255.255.0
NETWORK=172.16.2.0
ONBOOT=yes

Once you have this done hook the Linux box to the windoze box by using either a hub/switch or a crossover cable. Verify connectivity by pinging the Linux box from the windoze box.

Now you have to tell your linux box to forward packets (route traffic through its interfaces). You can do this by editing:
/etc/sysctl.conf and changing the line net.ipv4.ip_forward = 0

Change the 0 to a 1 and reboot your computer. Now you should be able to ping your router from the windoze computer and connect to the Internet. Hopefully this is not to confusing.

Good Luck!
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 20th October 2017 - 12:06 AM