PDA

View Full Version : Internet/lan-only lan working


Nejko
14th January 2006, 20:15
I have reinstalled my fedora core 4 like toturial said on howtoforge. I get lan working with eth0 but internet is'nt working. I have router. Server's IP is 192.168.2.103 , my ip and the newtork is 192.168.2.1. How to configure eth0?

THNX !

till
14th January 2006, 23:10
Do you have a dedicated router or is your server the router?

Nejko
15th January 2006, 07:46
dedicated router, with 4 computers on it. hod do i know that internet is not working? yum update gave me that:

[root@localhost ~]# yum update
Setting up Update Process
Setting up repositories
Cannot find a valid baseurl for repo: updates-released
[root@localhost ~]#

and i can ping only computers in my network.

and here is my eth0's config:

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.2.103
NETMASK=255.255.255.0
NETWORK=192.168.2.1
BROADCAST=192.168.2.255
ONBOOT=yes
MII_NOT_SUPPORTED=yes

what's wrong with it?

thanx for your answers!

till
15th January 2006, 12:45
In your eth0 config the gateway is missing.

Nejko
15th January 2006, 12:52
what do i add then?

till
15th January 2006, 13:09
Not shure how to do it in FC4 as i have currently Ubuntu installed.

Please post the output of:

netstat -rn

If the default route does not point to your gateway, you can set the routing on the commandline with:

/sbin/route add -net 0.0.0.0 gw 1.1.1.1 eth0

where you have to replace 1.1.1.1 with the IP address of your gateway.

Nejko
15th January 2006, 14:59
[root@localhost ~]# netstat -rn
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0
[root@localhost ~]#



/sbin/route add -net 0.0.0.0 gw 192.168.2.1 eth0

network restart.. still nothing :(

till
15th January 2006, 15:04
Ok, seems that your gateway is not set.

Do you have a file: /etc/sysconfig/network

and in the file the setting:

GATEWAY=1.1.1.1

where you have to replace 1.1.1.1 with the internal IP address of your router (gateway).

Nejko
15th January 2006, 15:25
i have set the file to:


NETWORKING=yes
HOSTNAME=localhost.localdomain
GATEWAY=192.168.2.1



still not working :(

Nejko
15th January 2006, 16:37
got it now workin' with my ppoe gateway :D:confused:

thanks for all your help

Nejko
15th January 2006, 18:15
got it now workin' with my ppoe gateway :D:confused:

thanks for all your help

edit: not working again :S


[root@localhost ~]# ping www.google.com
connect: Network is unreachable
[root@localhost ~]#

wtf?! i'll get crazy :(

falko
15th January 2006, 18:57
Does ping -c4 64.233.183.99 work? What does /etc/resolv.conf look like?

Nejko
15th January 2006, 19:10
[root@localhost ~]# ping -c4 64.233.183.99
connect: Network is unreachable
[root@localhost ~]#

; generated by /sbin/dhclient-script
nameserver 193.189.160.11
search localdomain

my eth0:

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.2.103
NETMASK=255.255.255.0
NETWORK=192.168.2.1
BROADCAST=192.168.2.200
GATEWAY=192.168.2.103
ONBOOT=yes

hope that helps :S

falko
15th January 2006, 19:45
Why don't you use

DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.2.103
NETMASK=255.255.255.0
NETWORK=192.168.2.0
BROADCAST=192.168.2.255
GATEWAY=192.168.2.103
ONBOOT=yes?

Nejko
15th January 2006, 20:39
i replaced, and restarted network, but still:


[root@localhost ~]# ping -c4 64.233.183.99
PING 64.233.183.99 (64.233.183.99) 56(84) bytes of data.
From 192.168.2.103 icmp_seq=0 Destination Host Unreachable
From 192.168.2.103 icmp_seq=1 Destination Host Unreachable
From 192.168.2.103 icmp_seq=2 Destination Host Unreachable
From 192.168.2.103 icmp_seq=3 Destination Host Unreachable

--- 64.233.183.99 ping statistics ---
4 packets transmitted, 0 received, +4 errors, 100% packet loss, time 3017ms
, pipe 4
[root@localhost ~]#

falko
16th January 2006, 09:39
Is your gateway really 192.168.2.103? Because that's the same IP address that you use for IPADDR...

Nejko
16th January 2006, 13:30
dunno :confused: here's two screens from my ruter:

[img=http://img3.imageshack.us/img3/1521/neimenovana0nw.th.jpg] (http://img3.imageshack.us/my.php?image=neimenovana0nw.jpg)

[img=http://img3.imageshack.us/img3/7135/neimenovana12wy.th.jpg] (http://img3.imageshack.us/my.php?image=neimenovana12wy.jpg)

[img=http://img3.imageshack.us/img3/386/neimenovana28nn.th.jpg] (http://img3.imageshack.us/my.php?image=neimenovana28nn.jpg)

hope that helps..

falko
16th January 2006, 19:28
Your gateway is 192.168.2.1.

Nejko
16th January 2006, 20:06
well, i have like that:


DEVICE=eth0
BOOTPROTO=static
IPADDR=192.168.2.103
NETMASK=255.255.255.0
NETWORK=192.168.2.1
BROADCAST=192.168.2.255
GATEWAY=192.168.2.1
ONBOOT=yes


but it's not working :S is there any other network config file i should edit?

falko
16th January 2006, 23:08
Please change
NETWORK=192.168.2.1
to NETWORK=192.168.2.0 and restart the network. If it doesn't help, reboot your server.

Also have a look at this page: http://www.subnetmask.info/

Nejko
17th January 2006, 06:18
now it's works. thnx for all your help! i can ping my other server in germany, i can acess to fc4 ftom my lan...

edit: yum update still doesn't work :(

but yum update:


[root@localhost ~]# yum update
Setting up Update Process
Setting up repositories
Cannot find a valid baseurl for repo: updates-released
[root@localhost ~]#

it's mybe becouse i canceled it one time?

falko
17th January 2006, 08:25
What does /etc/yum.conf look like?
Maybe these links help you:
http://www.brandonhutchinson.com/Fedora_apt_and_yum_repositories.html
http://www.fedora.us/wiki/FedoraSources#yum
http://www.google.com/search?q=yum+repositories&start=0&ie=utf-8&oe=utf-8&client=firefox-a&rls=org.mozilla:en-US:official

Nejko
17th January 2006, 13:51
[main]
cachedir=/var/cache/yum
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
retries=20
obsoletes=1
gpgcheck=1

# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
///////////
i'll just format and reinstall fedora :D i guess it will be easier. i'll post here what will be then :) thanx once again for Your help

edit: same sh*t :(

falko
17th January 2006, 17:49
I found this page: http://utcc.utoronto.ca/~cks/space/blog/2005/07/20/

So please post your /etc/resolv.conf here.

Nejko
17th January 2006, 18:18
search localdomain

just that in it...

falko
17th January 2006, 21:03
Change it to

search localdomain
nameserver 145.253.2.75
nameserver 193.174.32.18
nameserver 194.25.0.60

Nejko
17th January 2006, 21:40
still same... can u try? i sent pm to you couple hours ago...

not working....

till
18th January 2006, 13:27
still same... can u try? i sent pm to you couple hours ago...

not working....

Falko is currently in hollidays, laying at the beach with his girlfriend :) So better post to the forum.

Nejko
18th January 2006, 14:24
fc4 said that network is unreachable or something similar :) :rolleyes:

edit #1: connect: Network is unreachable


look at your inbox

till
18th January 2006, 16:03
Is this problem only related to yum or cant you connect to the internet at all. try e.g. "ping www.google.com" or "lynx www.google.com".

Please post the oitput of the command "ifconfig".

Nejko
18th January 2006, 18:07
[root@localhost ~]# ping -c4 www.google.com
ping: unknown host www.google.com
[root@localhost ~]#

[root@localhost ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:14:2A:BB:2B:F3
inet addr:192.168.2.103 Bcast:192.168.2.255 Mask:255.255.255.0
inet6 addr: fe80::214:2aff:febb:2bf3/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:661 errors:0 dropped:0 overruns:0 frame:0
TX packets:337 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:95772 (93.5 KiB) TX bytes:59456 (58.0 KiB)
Interrupt:185 Base address:0xc000

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:34 errors:0 dropped:0 overruns:0 frame:0
TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:6816 (6.6 KiB) TX bytes:6816 (6.6 KiB)

[root@localhost ~]#

falko
18th January 2006, 20:03
Are you sure you changed /etc/resolv.conf? Please double-check.
Please post the output of route -nee

Also, does ping -c4 64.233.183.99 work?

Nejko
18th January 2006, 20:21
[root@localhost ~]# route -nee
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface MSS Window irtt
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0 0 0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0 0 0
[root@localhost ~]# ping -c4 64.233.183.99
connect: Network is unreachable
[root@localhost ~]#


i'm sure for resolv.conf.. it's like that:

search localdomain
nameserver 145.253.2.75
nameserver 193.174.32.18
nameserver 194.25.0.60

:confused:

falko
18th January 2006, 20:45
[root@localhost ~]# route -nee
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface MSS Window irtt
192.168.2.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0 0 0 0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth0 0 0 0

Your system does not have a gateway. Please try tis again:
/sbin/route add -net 0.0.0.0 gw 192.168.2.1 eth0

If it doesn't help, reboot the system.

Nejko
18th January 2006, 20:59
heh, strange :) when it do command u posted, it works, but when i reboot it stops working again :)

till
18th January 2006, 22:04
This behaviour is normal, the routes get deleted when you reboot. Therefor you must set the gateway correctly to 192.168.2.1 as discussed in the prior posts.

Sorry, but i dont have an idea what else is wrong, i can only explain the reboot behaviour :)

falko
19th January 2006, 07:45
If setting the gateway doesn't work for you, you can put the line
/sbin/route add -net 0.0.0.0 gw 192.168.2.1 eth0 at the end of the start section in your network init script in /etc/init.d.
Then you should have an internet connection even after a reboot. :)

Nejko
19th January 2006, 13:40
k, did it :) now one question (offtopic)

[root@localhost ~]# yum install quota
Setting up Install Process
Setting up repositories
updates-released 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
base 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
Parsing package install arguments
Nothing to do
[root@localhost ~]# yum install quota
Setting up Install Process
Setting up repositories
updates-released 100% |=========================| 951 B 00:00
extras 100% |=========================| 1.1 kB 00:00
base 100% |=========================| 1.1 kB 00:00
Reading repository metadata in from local files
primary.xml.gz 100% |=========================| 964 kB 00:09
extras : ################################################## 2798/2798
Added 9 new packages, deleted 7 old in 2.84 seconds
Parsing package install arguments
Nothing to do
[root@localhost ~]#


i don't get it :=) any ideas?

falko
19th January 2006, 15:00
This means that the quota package is already installed.

Nejko
19th January 2006, 15:32
ok, cool. thanx for all help! :) next step, your control panel :D