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 05-21-2007, 12:02 PM   #1
ajaimes
Member
 
Registered: Dec 2004
Distribution: Ubuntu
Posts: 34

Rep: Reputation: 15
Unhappy I deleted my ip routing table!


Hi friends!, yesterday I was playing with my ip routing table and deleted it! now I can't even ifup one of my nics... please help me!!!

this is what I have:

3 nics all having static IP's.

eth1: ip 10.0.0.1, mask 255.255.255.0, I can do "ping 10.0.0.1" (ping itself) but can't ping other computers on that network, when I try to ifup I get "SIOCADDRT: Network is unreachable Failed to bring up eth1" if I try to ifdown I get "interface eth1 not configured"

eth2: same ping problem, but can ifup and ifdown

eth3: works ok...

when I do "ip route list" this is what I get:

192.168.1.0/24 dev eth3 proto kernel scope link src 192.168.1.10
default via 192.168.1.254 dev eth3


thanks a lot...
 
Old 05-21-2007, 12:15 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
just restart the network services, or reboot the box... routing tables are not persistent, they get created dynamically. what did you acutally do to "delete" them?
 
Old 05-21-2007, 12:35 PM   #3
ajaimes
Member
 
Registered: Dec 2004
Distribution: Ubuntu
Posts: 34

Original Poster
Rep: Reputation: 15
Unhappy Restarted didn't worked

I tried it... in fact when I restarted it was when stopped working... ('/etc/init.d/networking restart' and restart the whole computer)...

This is all I did yesterday (I was trying to have a redundant internet connection, and to be honest I don't understand ip route):


sudo ip route add 200.76.191.0 dev eth2 src 200.76.191.28 table 1
sudo ip route add default via 200.76.191.3 table 1
sudo ip route add 192.168.1.0 dev eth3 src 192.168.1.10 table 2
sudo ip route add default via 192.168.1.254 table 2

sudo ip route add 200.76.191.0 dev eth2 src 200.76.191.28
sudo ip route add 192.168.1.0 dev eth3 src 192.168.1.10

sudo ip route add default via 200.76.191.3

sudo ip rule add from 200.76.191.28 table 1
sudo ip rule add from 192.168.1.10 table 2

sudo ip route add 10.0.0.0 dev eth1 table 1
sudo ip route add 200.76.191.0 dev eth2 table 1
sudo ip route add 127.0.0.0/8 dev lo table 1
sudo ip route add 10.0.0.0 dev eth1 table 2
sudo ip route add 192.168.1.0 dev eth3 table 2
sudo ip route add 127.0.0.0/8 dev lo table 2

sudo ip route add default scope global nexthop via 200.76.191.3 dev eth2 weight 1 nexthop via 192.168.1.254 dev eth3 weight 1



sudo ip rule add from 200.76.191.28 lookup 1
sudo ip route add 10.0.0.0/24 via 10.0.0.1 table 1
sudo ip route add 0/0 via 200.76.191.70 table 1

sudo ip rule add from 192.168.1.10 lookup 2
sudo ip route add 10.0.0.0/24 via 10.0.0.1 table 2
sudo ip route add 0/0 via 192.168.1.254 table 2

sudo ip route add default equalize \
nexthop via 200.76.191.28 dev eth2 \
nexthop via 192.168.1.10 dev eth3

Last edited by ajaimes; 05-21-2007 at 12:40 PM.
 
Old 05-21-2007, 01:40 PM   #4
ajaimes
Member
 
Registered: Dec 2004
Distribution: Ubuntu
Posts: 34

Original Poster
Rep: Reputation: 15
Any idea?

any idea of what could happen? or do you know how can I restore my routing table?
 
Old 05-22-2007, 12:05 PM   #5
ajaimes
Member
 
Registered: Dec 2004
Distribution: Ubuntu
Posts: 34

Original Poster
Rep: Reputation: 15
loopback

When I "ip route list" I only get these 2 lines... I remember there was an additional line for 127.0.0.1... do you how to put it back?

192.168.1.0/24 dev eth3 proto kernel scope link src 192.168.1.10
default via 192.168.1.254 dev eth3
 
Old 05-22-2007, 12:47 PM   #6
ajaimes
Member
 
Registered: Dec 2004
Distribution: Ubuntu
Posts: 34

Original Poster
Rep: Reputation: 15
route -net

Doing this:

sudo route add -net 10.0.0.0/24 eth1

My network is somehow working now... DHCP server works and can ping from other computers to mine, but I can't ping from mine to the others... (no firewalls in other computers)
 
Old 05-22-2007, 01:06 PM   #7
ajaimes
Member
 
Registered: Dec 2004
Distribution: Ubuntu
Posts: 34

Original Poster
Rep: Reputation: 15
Getting better

It's pretty strange, but this happens now:

- eth3 connects to the internet and works ok
- eth1 connects to my internal network
- dhcp server on eth1 works ok
- bind on eth1 works ok
- internet connection sharing through eth1 works ok
- other computers can ping me ok

but...
- I can't ping other computers
- If I "ifdown eth1" I get: interface eth1 not configured
- If I "ifup eth1" I get: SIOCADDRT: Network is unreachable Failed to bring up eth1

So, there's still something wrong with the routing tables... I'm missing something, currently I get this when I "ip route list":

10.0.0.0/24 dev eth1 scope link
200.76.191.0/24 dev eth2 proto kernel scope link src 200.76.191.28
192.168.1.0/24 dev eth3 proto kernel scope link src 192.168.1.10
169.254..0/16 dev eth2 scope link metric 1000
default via 192.168.1.254 dev eth3
default via 200.76.191.3 dev eth2

any help is very appreciated
 
Old 05-22-2007, 02:00 PM   #8
ajaimes
Member
 
Registered: Dec 2004
Distribution: Ubuntu
Posts: 34

Original Poster
Rep: Reputation: 15
Ping working

Finally the only problems I have are these:

$ sudo ifdown eth1
ifdown: interface eth1 not configured

$ sudo ifup eth1
SIOCADDRT: Network is unreachable
Failed to bring up eth1.

BTW, I was taking a look to this file:
/etc/network/if-up.d/avahi-autoipd

and see it always creates this entry:
169.254.0.0/16 dev eth2 scope link metric 1000

any idea about this?
 
Old 05-22-2007, 02:14 PM   #9
ajaimes
Member
 
Registered: Dec 2004
Distribution: Ubuntu
Posts: 34

Original Poster
Rep: Reputation: 15
More info...

I read this "That's a routing problem, not a network driver problem. That can happen if the gateway you specified is not reachable *within one hop*. Either you've specified the wrong gateway, the wrong network, or the wrong subnet mask."
(http://www.beowulf.org/pipermail/rea...ry/000392.html)

So I modified the interfaces file to change from this:

auto eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.255.255.0
gateway 192.168.1.254

to this:

auto eth1
iface eth1 inet static
address 10.0.0.1
netmask 255.255.255.0
gateway 10.0.0.1

And I got the following errors:

$ sudo vi /etc/network/interfaces
$ sudo ifdown eth1
ifdown: interface eth1 not configured
$ sudo ifup eth1
RTNETLINK answers: File exists
run-parts: /etc/network/if-up.d/avahi-autoipd exited with return code 2
$ sudo ifdown eth1
$ sudo ifup eth1
RTNETLINK answers: File exists
run-parts: /etc/network/if-up.d/avahi-autoipd exited with return code 2

(see my last post about /etc/network/if-up.d/avahi-autoipd)

Well, I changed it back to 192.168.1.254 because internet stopped working... my guess here is:

192.168.1.254 is two hops far from 10.0.0.1 (192.168.1.10 is in the middle) so that's why it's telling me network is unreachable. So the question should be:

does eth1 really needs a gateway? and if it needs it which one is the best candidate?

Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 0.0.0.0 255.255.255.0 U 0 0 0 eth1
200.76.191.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
169.254.0.0 0.0.0.0 255.255.0.0 U 1000 0 0 eth2
0.0.0.0 192.168.1.254 0.0.0.0 UG 0 0 0 eth3
0.0.0.0 200.76.191.3 0.0.0.0 UG 0 0 0 eth2
 
  


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
routing table selie Linux - Networking 2 05-04-2007 09:12 AM
Partition deleted from table, can I get it back? serafean Linux - General 3 11-11-2006 12:25 PM
Partition table Deleted bcf2 Linux - Software 6 03-17-2006 09:23 AM
Recovering a deleted partition table while partitions still mounted suger Linux - General 5 01-02-2006 01:31 AM
routing table upr8830 Linux - Networking 6 06-18-2003 03:04 AM

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

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