LinuxQuestions.org
Review your favorite Linux distribution.
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 08-27-2009, 08:32 AM   #31
evilted
Member
 
Registered: Aug 2009
Location: Ouagadougou, Burkina Faso
Distribution: centos
Posts: 92

Rep: Reputation: 18

hey your observant!
interesting sometimes in the blur of it all even the simplest things are overlooked!
 
Old 08-27-2009, 08:46 AM   #32
evilted
Member
 
Registered: Aug 2009
Location: Ouagadougou, Burkina Faso
Distribution: centos
Posts: 92

Rep: Reputation: 18
Quote:
Originally Posted by fopetesl View Post
That sounds fine but if I had any idea how to modify the "default" routes already set up I would happily do so. As I already have said WTF are these routes set and in what file?
They certainly don't show in Network Manager GUI and none of the suggested paths/files contain this information.


the routes are added in 2 ways.

ifconfig
route


Quote:
Originally Posted by evilted View Post
Code:
ifconfig eth0 172.16.0.1/24

route

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
172.16.0.0     *               255.255.255.0   U     0      0        0 eth1


why not start again? everything has gotten confusing and out of control. you want the control back.

unplug everything except your netcat thing (or the device your having problems with). Most people forge to isolate things, setup your network. make sure you can reach your device BEOFRE you start expanding your network.



/etc/sysconfig/network-scripts/*

* can equal things like -> ifcfg-eth0

i use centos, and this (above) is the location for the network config at boot time (or when i execute the command 'service network restart'), and yes there are other places, but i would start here, and i would restart your network/machine to see what it is set to.

check the files here (or whereever they are for the distro your using).

a default gateway doesnt really matter, you can remove it:

route del default gw x.x.x.x

having a default wont matter because you are on the 192.x.x.x/24 and you are trying to reach a host on the same net/subnet. the default is basically where it goes when it doesnt match something in the routing table. (eg, you have 192.x.x.x and if you try to reach 4.2.2.1 then it wont find it in your routing table, and will then goto the default)..
 
Old 08-27-2009, 06:09 PM   #33
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
Correcting eth0's bad IP address should eliminate the bad routing table entry after rebooting. Look at the link I provided in post #29.

From the article:
Code:
/etc/network/interfaces

and the static routes in the following format:

up route add [-net|-host] <host/net>/<mask> gw <host/IP> dev <Interface>
If you keep both interfaces on the same network address and the same subnet, then try adding a host route in this file.

I think you man also need to delete the net route entry for eth0, so it doesn't interfere with eth1 which should be used for 192.168.1 traffic not going to 192.168.1.6. Having two route entries to the same network (192.168.1.0) may cause problems. Look in the /etc/network/interfaces file and see if configuring eth0 created a net route command. If so delete it, if not, add a route command to delete it. The third one below is what I am referring to.

Code:
192.168.1.6     0.0.0.0         255.255.255.255 UH    0      0        0 eth0
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth1
192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 eth0
The best solution is to change the default IP address for the embedded device, so it is on a different network. Then configure the IP address of eth1 so it's on the same network. You wouldn't need a host route in that case.

Last edited by jschiwal; 08-27-2009 at 06:31 PM.
 
Old 08-28-2009, 10:38 AM   #34
fopetesl
Member
 
Registered: Jan 2005
Location: Yorkshire Dales, UK
Distribution: Ubuntu 5.10; Mandriva 2007; Debian Lenny
Posts: 147

Original Poster
Rep: Reputation: 15
Exclamation Brain clouded with too much information!

Hey, guys. I have too much information to follow here.
So I took out both NICs, cleaned out ..etc/networks/interfaces ('cept for loopback) and rebooted.
Both route and ifconfig are now empty.
Reinstalled eth1 and get:
Code:
 route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
default         2WIRE133        0.0.0.0         UG    0      0        0 eth1
and can connect to the Net, (as you see).
BTW, why do I see 192.168.1.0?

And the next, (simple idiot newbie language, please), step to put eth0 (192.168.1.20) in connection with 192.168.1.6?
 
Old 08-28-2009, 10:50 AM   #35
evilted
Member
 
Registered: Aug 2009
Location: Ouagadougou, Burkina Faso
Distribution: centos
Posts: 92

Rep: Reputation: 18
Quote:
Originally Posted by fopetesl View Post
BTW, why do I see 192.168.1.0?
im not sure i understand you because its there:

Code:
 route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
can you post the output of 'ifconfig' please...
 
Old 08-28-2009, 10:57 AM   #36
rn_
Member
 
Registered: Jun 2009
Location: Orlando, FL, USA
Distribution: Suse, Redhat
Posts: 127
Blog Entries: 1

Rep: Reputation: 25
Quote:
Originally Posted by fopetesl View Post
BTW, why do I see 192.168.1.0?
That's because your 2wire133 router is setting it. Actually, it might be a good idea to login to your router and change your internet-facing nw side to a different address, which would make this routing a little bit simpler.
 
Old 08-28-2009, 11:06 AM   #37
evilted
Member
 
Registered: Aug 2009
Location: Ouagadougou, Burkina Faso
Distribution: centos
Posts: 92

Rep: Reputation: 18
i misread his post .. thought he said why do i not see it! ha. ill shutup now!

Last edited by evilted; 08-28-2009 at 11:08 AM.
 
Old 08-28-2009, 11:11 AM   #38
fopetesl
Member
 
Registered: Jan 2005
Location: Yorkshire Dales, UK
Distribution: Ubuntu 5.10; Mandriva 2007; Debian Lenny
Posts: 147

Original Poster
Rep: Reputation: 15
Post

Quote:
Originally Posted by evilted View Post
can you post the output of 'ifconfig' please...
Code:
 ifconfig
eth1      Link encap:Ethernet  HWaddr 00:40:63:DE:CF:BF
          inet addr:192.168.1.38  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1976 errors:0 dropped:0 overruns:0 frame:0
          TX packets:765 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:616983 (602.5 KiB)  TX bytes:175018 (170.9 KiB)
          Interrupt:10 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:140 errors:0 dropped:0 overruns:0 frame:0
          TX packets:140 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:328262 (320.5 KiB)  TX bytes:328262 (320.5 KiB)
...and eth0?
 
Old 08-28-2009, 11:18 AM   #39
rn_
Member
 
Registered: Jun 2009
Location: Orlando, FL, USA
Distribution: Suse, Redhat
Posts: 127
Blog Entries: 1

Rep: Reputation: 25
Quote:
Originally Posted by fopetesl View Post

...and eth0?
try ifconfig -a
 
Old 08-28-2009, 11:22 AM   #40
fopetesl
Member
 
Registered: Jan 2005
Location: Yorkshire Dales, UK
Distribution: Ubuntu 5.10; Mandriva 2007; Debian Lenny
Posts: 147

Original Poster
Rep: Reputation: 15
Post

Quote:
Originally Posted by rn_ View Post
try ifconfig -a
Code:
 ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:30:BD:70:34:12
          BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:11 Base address:0xe000
How to (simply, please) set eth0 to talk to 192.168.1.6?
 
Old 08-28-2009, 11:29 AM   #41
rn_
Member
 
Registered: Jun 2009
Location: Orlando, FL, USA
Distribution: Suse, Redhat
Posts: 127
Blog Entries: 1

Rep: Reputation: 25
i'm trying to keep my posts short and to-the-point to try and minimize the confusion (hopefully) and also to give other more knowledgeable people a chance to chime in. (also this way i will have more posts :> ).

if you're unable to change any of the ip addresses, is it possible to hook the 192.168.1.6 machine up to the router as well and let that deal with the routing? only thing is that all your traffic will be routed through eth1; would it make a difference? If you decide to do that, just be sure to mark the 192.168.1.6 ip address as static in the router.
 
Old 08-28-2009, 11:36 AM   #42
rn_
Member
 
Registered: Jun 2009
Location: Orlando, FL, USA
Distribution: Suse, Redhat
Posts: 127
Blog Entries: 1

Rep: Reputation: 25
Quote:
Originally Posted by fopetesl View Post
How to (simply, please) set eth0 to talk to 192.168.1.6?
first step:

Code:
ifconfig eth0 192.168.1.20 up

ifconfig (to verify it is up)
 
Old 08-28-2009, 11:46 AM   #43
fopetesl
Member
 
Registered: Jan 2005
Location: Yorkshire Dales, UK
Distribution: Ubuntu 5.10; Mandriva 2007; Debian Lenny
Posts: 147

Original Poster
Rep: Reputation: 15
Question

Code:
~$ sudo ifconfig eth0 192.168.1.20 up
~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:30:BD:70:34:12
          inet addr:192.168.1.20  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:11 Base address:0xe000
This is up?

Oh. Physically almost impossible to hook up to external router
 
Old 08-28-2009, 11:53 AM   #44
rn_
Member
 
Registered: Jun 2009
Location: Orlando, FL, USA
Distribution: Suse, Redhat
Posts: 127
Blog Entries: 1

Rep: Reputation: 25
Quote:
Originally Posted by fopetesl View Post
Code:
~$ sudo ifconfig eth0 192.168.1.20 up
~$ ifconfig -a
eth0      Link encap:Ethernet  HWaddr 00:30:BD:70:34:12
          inet addr:192.168.1.20  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)
          Interrupt:11 Base address:0xe000
This is up?

Oh. Physically almost impossible to hook up to external router
Looks like it is up. if you do ifconfig without the -a, it will only show you interfaces that are up.

step two:

Code:
route add -host 192.168.1.6 gw 192.168.1.20
to verify:

Code:
ping 192.168.1.6
traceroute 192.168.1.6

And that's it. you can add a third step to make the route permanent by looking at some of the previous posts. But, if this doesn't work, then i'm out of ideas. perhaps someone with more experience can show us the path (pun intended! )
 
Old 08-28-2009, 12:07 PM   #45
fopetesl
Member
 
Registered: Jan 2005
Location: Yorkshire Dales, UK
Distribution: Ubuntu 5.10; Mandriva 2007; Debian Lenny
Posts: 147

Original Poster
Rep: Reputation: 15
Unhappy Oh dear! Back to square one

Code:
~$ sudo route add -host 192.168.1.6 gw 192.168.1.20
~$ ping 192.168.1.6
PING 192.168.1.6 (192.168.1.6) 56(84) bytes of data.
From 192.168.1.20 icmp_seq=2 Destination Host Unreachable
From 192.168.1.20 icmp_seq=3 Destination Host Unreachable

~$ sudo traceroute eth0
sudo: traceroute: command not found

:~$ route
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
christravel     192.168.1.20    255.255.255.255 UGH   0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth1
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
default         2WIRE133        0.0.0.0         UG    0      0        0 eth1
and unknown avatar christravel is back with me again!
 
  


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
How do I tell my server to use eth0 for the internet [DNS + gateway] in stead of eth1 elvisious Linux - Networking 1 02-14-2009 05:53 PM
Eth0 using DHCP and eth1 using static ip: eth0 receive internal ip not the router ip geraldomanaus Linux - Networking 3 04-23-2008 03:00 PM
eth0, eth1, dhcp, slackware 11 problem q3noob Slackware 5 07-31-2007 09:26 AM
Dhcp eth0 and XP eth1 internet sharing props666999 Slackware 8 08-20-2005 09:48 AM
How do I set the ip address for eth0, eth1 and the default gateway? abefroman SUSE / openSUSE 5 05-19-2005 04:15 AM

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

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