View previous topic :: View next topic |
Author |
Message |
macro n00b
Joined: 20 Feb 2003 Posts: 23
|
Posted: Fri Jul 11, 2003 5:49 am Post subject: home lan box unable to escape subnet |
|
|
I'm on a small home network with an adsl router as my gateway on the 192.169.1.x subnet.
the router has dhcp facilities and if I dhcpcd my eth0 everything works fine (and dns entries are updated in resolv.conf)
However, when I try to manually specify an ip instead of using dhcp, I can't get out of my subnet. (I believe I also had this problem on initial setup, and I believe that when I specified the credentials using the net-setup prog everything worked fine).
This is using dhcp from the router
Code: |
root@frodo / # ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:04:5A:56:1B:67
inet addr:192.168.1.200 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3807 errors:0 dropped:0 overruns:0 frame:0
TX packets:2568 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:4976998 (4.7 Mb) TX bytes:239838 (234.2 Kb)
Interrupt:10 Base address:0xd400
|
now if I take it down and manually config...
Code: |
root@frodo / # ifconfig eth0 0.0.0.0
root@frodo / # ifconfig eth0 192.168.1.50 broadcast 192.168.1.255 netmask 255.255.255.0
root@frodo / # ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:04:5A:56:1B:67
inet addr:192.168.1.50 Bcast:192.168.1.255 Mask:255.255.255.0
UP BROADCAST NOTRAILERS RUNNING MULTICAST MTU:1500 Metric:1
RX packets:3807 errors:0 dropped:0 overruns:0 frame:0
TX packets:2568 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:4976998 (4.7 Mb) TX bytes:239838 (234.2 Kb)
Interrupt:10 Base address:0xd400
root@frodo / # ping www.google.com
ping: unknown host www.google.com
root@frodo / # ping 192.168.1.201
PING 192.168.1.201 (192.168.1.201) 56(84) bytes of data.
64 bytes from 192.168.1.201: icmp_seq=1 ttl=64 time=0.363 ms
--- 192.168.1.201 ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 0.363/0.363/0.363/0.000 ms
root@frodo / # arp
Address HWtype HWaddress Flags Mask Iface
192.168.1.201 ether 00:10:A4:7B:29:A8 C eth0
root@frodo / # cat /etc/resolv.conf
nameserver 207.203.159.252
nameserver 205.152.0.5
root@frodo / # ping 207.203.159.252
connect: Network is unreachable
root@frodo / #
|
I also tried 192.168.1.1 as the b-cast (for fun?) which is the ip of the router.
what gives? |
|
Back to top |
|
|
ben Apprentice
Joined: 10 Jun 2002 Posts: 285 Location: Switzerland
|
Posted: Fri Jul 11, 2003 6:05 am Post subject: home lan box unable to escape subnet |
|
|
Hi,
When you setup your network card manuallz you must take care of at least 3 things:
1.- IP address + subnet mask
2.- /etc/resolv.conf
3.- Routing table
I thing the third one is missing by you. with netstat -nr you can see a list of route that you have. And with route add a.b.c.d(destination address) netmask e.f.g.h gw 192.168.1.1(gateway address) you should be able to add the missing route. for example( i am not near a linux box so this is from memory)
route add 0.0.0.0 netmask 0.0.0.0 gw 192.168.1.201 or
route add default gw 192.168.1.201 should be enough to let you out of your home net.
Ben |
|
Back to top |
|
|
macro n00b
Joined: 20 Feb 2003 Posts: 23
|
Posted: Fri Jul 11, 2003 6:12 am Post subject: doh |
|
|
ahh, it happened the way it always happens. As soon as I post, I find the answer myself and get to feel dumb, heh.
route add default gw 192.168.1.1 eth0 seemed to do the trick.
is there some way to stick this into the configuration (like /etc/conf.d/net) or should I just stick it in my local.start ? |
|
Back to top |
|
|
ben Apprentice
Joined: 10 Jun 2002 Posts: 285 Location: Switzerland
|
Posted: Fri Jul 11, 2003 6:27 am Post subject: doh |
|
|
Argh, I had the right answer and you did not even read it. So I won't tell you how to put this info to have it automatically, na, na, nah
int /etc/conf.d/net:
at the end you have to uncomment the line which says:
gateway="eth0/192.168.1.201"
assuming your net card is eth0
This time please read it before you find the answer in /etc/conf.d/net comments
Bye |
|
Back to top |
|
|
macro n00b
Joined: 20 Feb 2003 Posts: 23
|
Posted: Fri Jul 11, 2003 6:30 am Post subject: lol |
|
|
thanks Ben!
Just a curse I pose =) I could search the net for 2 hours trying to solve something, and once I reach out for help the answer is staring me in the face most of the time.
but again, appreciate it! |
|
Back to top |
|
|
ben Apprentice
Joined: 10 Jun 2002 Posts: 285 Location: Switzerland
|
Posted: Fri Jul 11, 2003 8:07 am Post subject: life experience |
|
|
That nothing,
It's typical, did you see how talking to your wife/girlfriend about the mistery of say kernel compilation, or VPN over NAT helped greatly to solve things ? Usually just because it help you to clarifie the question, so that the answer become obvious.
Unless, of course, she actually IS a guru and HAS the answer, which sometimes happens too
Have fun
Ben |
|
Back to top |
|
|
|