Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
04-06-2005, 01:47 AM
|
#1
|
Member
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223
Rep:
|
configuring eth interfaces problem
hello,
I have Local interfaces are configured as
[root@localhost root]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:08:A1:43:61:F5
inet addr:10.0.1.100 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 b) TX bytes:240 (240.0 b)
Interrupt:9 Base address:0xbc00
eth1 Link encap:Ethernet HWaddr 00:80:48:C3:11:94
inet addr:10.0.1.200 Bcast:10.255.255.255 Mask:255.0.0.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:7 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:915 (915.0 b) TX bytes:420 (420.0 b)
Interrupt:11 Base address:0xdc00
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:8 errors:0 dropped:0 overruns:0 frame:0
TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:784 (784.0 b) TX bytes:784 (784.0 b)
and Routing table
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth1
10.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 eth1
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.0.1.100 0.0.0.0 UG 0 0 0 eth0
When i ifdown eth1 at start in rc.local so that it will not start by default my configuration for kernel routing table is
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
127.0.0.0 0.0.0.0 255.0.0.0 U 0 0 0 lo
0.0.0.0 10.0.1.100 0.0.0.0 UG 0 0 0 eth0
I want to make eth0 alone work by successfully pinging to another pc which is connected by crossover wire. what cheages shoul i do? I tried with
route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.0.1.100
but it fails with error
SIOCADDRT: Network is unreachable
Then i up eth1 and my routing table is as given above. then i give following commands
route del -net 0.0.0.0 netmask 0.0.0.0 gw 10.0.1.100
route add -net 0.0.0.0 netmask 0.0.0.0 gw 10.0.2.100 //10.0.2.100 is eth0 of other pc
but besides that i get following erorros
ping 10.0.2.100
PING 10.0.2.100 (10.0.2.100) 56(84) bytes of data.
From 10.0.1.200 icmp_seq=1 Destination Host Unreachable
From 10.0.1.200 icmp_seq=2 Destination Host Unreachable
From 10.0.1.200 icmp_seq=3 Destination Host Unreachable
|
|
|
04-06-2005, 05:53 AM
|
#2
|
Senior Member
Registered: Mar 2004
Location: england
Distribution: Mint, Armbian, NetBSD, Puppy, Raspbian
Posts: 3,516
|
have you tried using the 192.168.1.0
subnet?
Or is there a reason you use the 10?
|
|
|
04-06-2005, 07:18 AM
|
#3
|
Senior Member
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024
Rep:
|
Quote:
Originally posted by bigearsbilly
have you tried using the 192.168.1.0
subnet?
Or is there a reason you use the 10?
|
that's the idea, to exapnd some more, I see these IP addresses:
eth0 10.0.1.100 255.0.0.0
eth1 10.0.1.200 255.0.0.0
and what you should do is place the two network cards in different 'IP subnets' (or bridge the interfaces, which is more of a hack than a fix.) To do this, use a different private IP space, such as 192.168.1.0 255.255.255.0 for either of the two interfaces. I would suggest changing the one that has the crossover to the other computer so it and the other system have say 192.168.1.1 and 192.168.1.2 as their IP addresses. The reason you have route problems is because both of your current IP addresses are on one subnet that includes all addresses from 10.0.0.1 to 10.255.255.254 and the system can't figure out which interface to use. If you change one of the IP addresses, you should not need to do anything to the routing tables.
|
|
|
04-06-2005, 07:23 AM
|
#4
|
Senior Member
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024
Rep:
|
It also appears that you posted two threads, this one and http://www.linuxquestions.org/questi...hreadid=310235
The two posts appear to be about the same setup, and I think the two questions you asked are likely related.
|
|
|
04-06-2005, 07:44 AM
|
#5
|
Member
Registered: Feb 2004
Distribution: FC4,RHEL4
Posts: 223
Original Poster
Rep:
|
Hello Darin,
Thanks for reply. Does that mean i can not set both NICs to same subnet or having more that 2 NICs need to set all to different subnets?
What is happening is that i make ifdown eth1 at bootup in rc.local, so when pc starts eth1 does not ups but some times when i up eth1 eth0 goes disappeared from route -n but displays in ifconfig command. and if eth1 or eth0 is up or down my computer always wants eth1 to be active to send traffice on net.
Why is this happening? is that because both NIC on same subnet or anything else reason is there?
|
|
|
04-07-2005, 07:55 AM
|
#6
|
Senior Member
Registered: Jan 2003
Location: Portland, OR USA
Distribution: Slackware, SLAX, Gentoo, RH/Fedora
Posts: 1,024
Rep:
|
Quote:
Originally posted by cranium2004
Hello Darin,
Thanks for reply. Does that mean i can not set both NICs to same subnet or having more that 2 NICs need to set all to different subnets?
|
The practical answer is no. The idea of different subnets is mostly to differentiate physical networks so if you have two different network cards it's best to have different subnets.
Quote:
What is happening is that i make ifdown eth1 at bootup in rc.local, so when pc starts eth1 does not ups but some times when i up eth1 eth0 goes disappeared from route -n but displays in ifconfig command. and if eth1 or eth0 is up or down my computer always wants eth1 to be active to send traffice on net.
Why is this happening? is that because both NIC on same subnet or anything else reason is there?
|
This is due to them being on the same IP subnet, Linux can be set to work that way but it requires more advanced configuration so that's why the routing table goes banannas when you bring up a second NIC on the same subnet. Again different IP subnets usually means different physical (wired) networks.
|
|
|
All times are GMT -5. The time now is 08:22 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|