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 02-22-2005, 07:13 AM   #1
perdesiz
Member
 
Registered: Aug 2003
Location: Turkey
Posts: 88

Rep: Reputation: 15
Question I think this is an "ip forwarding" problem...


I do have a desktop PC in my office and it is connected to LAN via ethernet(say eth0). What I do wanna do is connecting another ethernet card(say eth1) to that desktop PC and connect my laptop to network over that PC.
When I connected second ethernet card my connection has gone somehow.

when I run "lspci" command I can see both of my ethernet cards and when I run "ifconfig" I see that there is no change on my network adjustments for eth0 but my connection is somehow gone. I tested it simply by running "ping" command.

Furthermore I tried to add net by "route" command for "dev eth1" by
"route add -net 192.168.99.0 netmask 255.255.255.0 dev eth1"

but It gives an error as "SIOCADDRT: No such device"

what should I do ? Any Ideas?
 
Old 02-22-2005, 07:20 AM   #2
visiondream3
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Rep: Reputation: 0
Hi,
I have faced the exact error when I didnt have enough permissions. ie when I was not the root user.
 
Old 02-22-2005, 07:27 AM   #3
perdesiz
Member
 
Registered: Aug 2003
Location: Turkey
Posts: 88

Original Poster
Rep: Reputation: 15
I ve been "root"

that is not the problem.
May be it is OS specific.
I am using slackware 10.0
 
Old 02-22-2005, 07:45 AM   #4
visiondream3
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Rep: Reputation: 0
You're sure forwarding is enabled ?

net.ipv4.ip_forward = 1 in /etc/sysctl.conf ?
 
Old 02-22-2005, 07:50 AM   #5
perdesiz
Member
 
Registered: Aug 2003
Location: Turkey
Posts: 88

Original Poster
Rep: Reputation: 15
there is no file called sysctl.conf under /etc directory actually
 
Old 02-22-2005, 07:54 AM   #6
visiondream3
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Rep: Reputation: 0
what abt this one :

/proc/sys/net/ipv4/ip_forward

do you have that ?

what kernel are u running ?
 
Old 02-22-2005, 07:58 AM   #7
perdesiz
Member
 
Registered: Aug 2003
Location: Turkey
Posts: 88

Original Poster
Rep: Reputation: 15
the kernel is 2.4.26
the parameter you say is 1 in my system
 
Old 02-22-2005, 08:18 AM   #8
visiondream3
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Rep: Reputation: 0
I have a lan setup here, and this is all I had to do :

made sure /proc/sys/net/ipv4/ip_forward is 1.

enabled IP masquerading :

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

iptables -A FORWARD -s your_lan_ip_range -j ACCEPT
iptables -A FORWARD -d your_lan_ip_range -j ACCEPT

now all packets coming to eth0 gets forwarded.

now set the route.
 
Old 02-22-2005, 08:42 AM   #9
perdesiz
Member
 
Registered: Aug 2003
Location: Turkey
Posts: 88

Original Poster
Rep: Reputation: 15
I have performed what you said.

No change...

Here is my problem first of all;

I have a working LAN connection via ethernet. But when I connect a second ethernet card the connection goes off...

First of all I have to enable my network connection with 2 ethernet cards installed. This must be the first step .What you think?
 
Old 02-22-2005, 10:04 AM   #10
visiondream3
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Rep: Reputation: 0
Hi,
You can bring up both ethernet cards separately.

ifconfig eth0 192.168.1.1 up
ifconfig eth1 192.168.1.2 up

You can now start using them.

sorry, correct it as given above :

Quote:
Hi,
You can bring up both ethernet cards separately.

ifconfig eth0 192.168.1.1 up
ifconfig eth0 192.168.1.2 up

You can now start using them.

Last edited by visiondream3; 02-22-2005 at 10:05 AM.
 
Old 02-22-2005, 10:45 AM   #11
perdesiz
Member
 
Registered: Aug 2003
Location: Turkey
Posts: 88

Original Poster
Rep: Reputation: 15
hi,

first of all thanx for your interest.

Now my LAN ip for eth1 is something like 193. .... .101

now when I just make "ifconfig eth1 192.168.1.1 up" my connection goes off...
I tried giving the same ip to eth1 (namely the one starting with 193. ... )as well, then I could connect to intranet but not internet.

I guess this problem is caused by the fact that I use two ethernet cards with the same chipset...

What you think?
 
Old 02-22-2005, 10:51 AM   #12
visiondream3
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Rep: Reputation: 0
Hello,
if your card is already up. You have to bring it down before trying to bring it up.

Do,

ifconfig eth1 present_ip down
ifconfig eth1 new_ip up

should do the job

( Make sure you are local and not connected through eth1 and networked, or you'll get kicked out when you bring the interface down )
 
Old 02-22-2005, 11:00 AM   #13
perdesiz
Member
 
Registered: Aug 2003
Location: Turkey
Posts: 88

Original Poster
Rep: Reputation: 15
I wrote something wrong as a result you misunderstood, sorry for that...
Now my LAN ip for eth0 (not 1) is something like 193. .... .101 (this ip is the one I sholu have for my connection to LAN)

now when I just make "ifconfig eth1 192.168.1.1 up" my connection (the one related to eth0 ) goes off...

What I wanna do is that giving 192.168.1.1 to the eth1 on my desktop pc and giving my laptop 192.168.1.2 and then connecting to internet via my desktop pc. ...

I guess this problem is caused by the fact that I use two ethernet cards with the same chipset...


Now what you think??
 
Old 02-22-2005, 11:40 AM   #14
visiondream3
LQ Newbie
 
Registered: Feb 2005
Posts: 9

Rep: Reputation: 0
If you are connecting the internet ip on the eth0, it should not be a LAN ip.
If you are on a dhcp ( dsl connection) then the ethernet end provided by your ISP will bring up whatever ip your eth0 needs to have.
You just need to bring up a local ip on the eth1 then. After this you can setup the forwarding on eth1 as we discussed earlier.

If you have a problem identifying eth0 and eth1, please get a pic of your desktop pc's (backside of the cabinet.) and your connection.
We should be able to figure something out

Also, may be you should try the network setup command specific to slackware.

redhat has this command called 'setup' that helps you to configure network configuration.
 
Old 02-22-2005, 11:48 AM   #15
Baco
LQ Newbie
 
Registered: May 2004
Location: Portugal
Distribution: Gentoo
Posts: 21

Rep: Reputation: 15
I would say that you have to fix that conflit problem between those 2 ethernet cards...
They should BOTH be working just fine with 2 diferent IP's.

I have a machine doing exactly what u want to do....
this is the output from the ifconfig


[root@cm-84-90-1X-XX root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:50:FC:5A:3D:CA
inet addr:84.90.1X.XX Bcast:84.90.19.255 Mask:255.255.252.0
inet6 addr: fe80::250:fcff:fe5a:3dca/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:646256 errors:0 dropped:0 overruns:0 frame:0
TX packets:736128 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:453562341 (432.5 Mb) TX bytes:198945329 (189.7 Mb)
Interrupt:11 Base address:0x5000

eth1 Link encap:Ethernet HWaddr 00:0A:CD:04:42:48
inet addr:192.168.0.1 Bcast:192.168.0.255 Mask:255.255.255.0
inet6 addr: fe80::20a:cdff:fe04:4248/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:741732 errors:0 dropped:0 overruns:0 frame:0
TX packets:646326 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:199627796 (190.3 Mb) TX bytes:453672379 (432.6 Mb)
Interrupt:9 Base address:0xc000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:821 errors:0 dropped:0 overruns:0 frame:0
TX packets:821 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:108466 (105.9 Kb) TX bytes:108466 (105.9 Kb)

To do this I have made a script to configure IPTABLES, I can post it if u want tho u need to have those 2 cards up before u can do anything.
 
  


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
Telling people to use "Google," to "RTFM," or "Use the search feature" Ausar General 77 03-21-2010 11:26 AM
"Xlib: extension "XFree86-DRI" missing on display ":0.0"." zaps Linux - Games 9 05-14-2007 03:07 PM
Debian Boot Up Problem - stuck at "BR" & "I" jc70417 Debian 2 08-30-2005 04:36 PM
problem "make"ing gtk+ "/usr/bin/env: perl -w" caid Linux - Newbie 8 07-29-2005 04:51 AM
Sound problem with "alsamixer" or "alsaconf" or sth else maybe... Mikuda Linux - Games 4 05-01-2004 11:09 AM

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

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