'route add default gw ...' not working

T

transmogrifier

Grünschnabel
Hi,
I have a newly installed Knoppix/Debian.

My problem: I can't reach any IP outside my network - this is probably because there is no route:
#route
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0

My DSL-Router is 192.168.1.1 and I can it ping it without any problem.
But when I try
(after: ifconfig eth0 down - and also up)

route add default gw 192.168.1.1

I always get the message:
network is unreachable

What is specially terrible: it worked today already!
I followed the same steps (after some trouble to find the route command) and suddenly everything worked fine!
So I know that the card, cables, drivers and whatever is o.k.
- has anybody any hint?
But now it won't anymore.

I would be really, really glad!
 
Hi!
Try to use (as root) "netenv" to set up your network.
that should solve your Problem....

Another way is to edit the necessary files directly..
greetz Andre ;-)
 
netenv doesn't help

Hi Andre,
thank's for your answer!
- but netenv doesn't seem to change anything.

I would be very glad to insert my defaultroute directly - but which f..ng file is it???

Everybody is always speaking about the routing table but I can't find it - is it possible to edit it directly?
And what do I have to insert to have the analogue for:
route add default gw 192.168.1.1 ?

BTW: Do you have an idea where the problem comes from?
I suppose normally linux would find the network during the boot process - but it doesn't. There is already the message "The network is unreachable".
But nevertheless I can ping any pc in my network.

Thank's a lot for your help!
 
I think "etc/network/interfaces" is what you are looking for ;-)


Code:
linus@FuckUp:~$ cat /etc/network/interfaces
# /etc/network/interfaces -- configuration file for ifup(8), ifdown(8)

# The loopback interface
auto lo
iface lo inet loopback

# The first network card - this entry was created during the Debian installation
# (network, broadcast and gateway are optional)
auto eth0
iface eth0 inet static
        address 192.168.0.8
        netmask 255.255.255.0
        network 192.168.0.0
        broadcast 192.168.0.255
        gateway 192.168.0.3

I hope that helps...

?(
 
Hi Andre,
this wasn't the problem either.

Now I removed Knoppix and installed pure Debian and everything was immediatly working well.

Anyway, thank's a lot for your help.
 
I would guess that the whole thing is a iptables problem!
I dont exactly know the Knoppix Distribution. But my Redhat for example had a automatically configured firewall that always caused this problem.

Just do a iptables -F to delete the rules and then try again ...
 

Ähnliche Themen

Email via script via Exchange Server (SASL)

Zugriff Ubuntu 16.04. auf Freigabe 18.04. LTS nicht möglich

Debian Gateway

Akonadi startet nicht mehr

Samba 4 Gast Zugang unter Ubuntu funktioniert nicht

Zurück
Oben