LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Networking (https://www.linuxquestions.org/questions/linux-networking-3/)
-   -   Heop with Static-IP setup in Gentoo (https://www.linuxquestions.org/questions/linux-networking-3/heop-with-static-ip-setup-in-gentoo-718548/)

metacym 04-12-2009 02:06 AM

Heop with Static-IP setup in Gentoo
 
i want to receive ethernet-connection from 192.168.2.1

I dont care what the box's IP has to be, but i had randomly set it to
192.168.1.120 because my other computer on the LAN is 192.168.1.119


So, I set the configuration to this:



modules=( "ifconfig" )
# the primary network interface
auto eth0
iface eth0 inet static
address 192.168.1.120
netmask 255.255.255.0
network 192.168.2.1
broadcast 192.168.1.255
gateway 192.168.1.118

#dns-* options are implemented by the resolvconf package, if installed
dns-nameserver 192.168.2.1




As far as ifconfig is concerned, It appears to be working.
I fear i have set something up wrong, for web-browsing, Ping, and netstat all confirm i am not actually getting internet connectivity.

route -n prints:

Code:

Destination            Gateway              Genmask          flags  metric ref    Use  Iface
192.168.1.0          0.0.0.0                255.255.255.0    U        0      0      0      eth0
127.0.0.0              0.0.0.0                255.0.0.0          U        0      0      0      Lo
0.0.0.0                192.168.1.118      0.0.0.0              UG      0      0      0      eth0


repo 04-12-2009 03:44 AM

Quote:

network 192.168.2.1
shouldn't this be
Quote:

network 192.168.1.0
Can you ping
192.168.1.118 ?

metacym 04-12-2009 04:01 AM

Hi, thanks for your reply.

The IP address i am receiving the eth0 connection from is

correctly 192.168.2.1

It is coming to the gentoo box via a macbook pro with 'ethernet sharing' turned on as a service. So i assumed that i would put that IP address as the 'router' in this case, since the gentoo box is only being served a connection from the macbook pro, opposed to the actual router.

repo 04-12-2009 04:07 AM

So
192.168.2.1
is the gateway ?


Code:

modules=( "ifconfig" )
# the primary network interface
auto eth0
iface eth0 inet static
address 192.168.2.120
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
gateway 192.168.2.1


metacym 04-12-2009 04:21 AM

I am sorry. that was incorrect. I am not on the actual computer, so i am typing from a different station.
the current configuration has been simplified down to this /etc/conf.d/net file:

modules=( "ifconfig" )
config_eth0=( "192.168.120/24" )
routes_eth0=( "default via 192.168.1.118" )

metacym 04-12-2009 04:28 AM

and no, i cannot seem to ping 192.18.1.118

repo 04-12-2009 05:02 AM

Quote:

i want to receive ethernet-connection from 192.168.2.1
Then 192.168.2.1 should be the gateway, no?
What is connected to
192.168.1.118 ?

How is the setup from your network?

internet <=> 192.168.2.1 <=> 192.168.2.120

This doesn't seem correct
config_eth0=( "192.168.120/24" )


make sure you stay in the same subnet for all addresses.
why do you use
192.168.1.* and 192.168.2.*

metacym 04-12-2009 05:21 AM

Quote:

Originally Posted by repo (Post 3506189)
Then 192.168.2.1 should be the gateway, no?
What is connected to
192.168.1.118 ?

How is the setup from your network?

internet <=> 192.168.2.1 <=> 192.168.2.120

This doesn't seem correct
config_eth0=( "192.168.120/24" )


make sure you stay in the same subnet for all addresses.
why do you use
192.168.1.* and 192.168.2.*



192.168.1.118 was just the IP i picked for default gateway.

the gentoo box is receiving ethernet connection from a macbook pro which is sharing it's ethernet-connection. the IP the macbook pro gives to share ethernet with is 192.168.2.1



I was told in the #Gentoo-AMD IRC channel that this:


config_eth0=( "192.168.120/24" )
was a correct way for gentoo.

However, i am not 100% clear on how TCP/IP works sometimes. So are you saying that the client IP of 192.168.1.118 cannot use gateway 192.168.2.1?


thanks again

repo 04-12-2009 05:29 AM

Quote:

192.168.1.118 was just the IP i picked for default gateway.
you just picked it at random ?

As default gw you need to use the ip from the router or the server which makes the connection.
in your case 192.168.2.1

Did you tried the setup from post #4 ?

Do you have connection from the other computer on the lan (192.168.1.119)
If yes, just copy the settings.

metacym 04-12-2009 05:38 AM

thanks to your last post, i appear to have made progress, but still cannot use portage or web-browser. I changed static IP to
192.168.2.120, and now can ping the IP 192.168.2.1

additionally, I can also pick up the gentoo box on the IP-Scanner from the macbook pro server, which i have not been able to do ever, until now.

Also, i no longer think it is a bad NIC, because pinging 127.0.0.1 from the gentoo box.

It is quite odd that it seems all signal say this machine should be getting internet access, yet for all purposes it is still unable to.

repo 04-12-2009 06:30 AM

Can you ping
209.85.227.104
Can you ping
www.google.com

Did you add the correct DNS servers ?

metacym 04-12-2009 06:47 AM

this is an odd result, but pinging that IP you posted just returns a line like it is doing something, but the cursor doesnt complete a blink, it just freezes before it blinks once, and then it just times-out, but never gives any error message or confirmation of anything.

pinging www.google.com prints the error 'unknown host'

i added the dns server as 192.168.2.1

repo 04-12-2009 06:54 AM

Quote:

i added the dns server as 192.168.2.1
Is there a DNS server configured at 192.168.2.1 ?
what is the output from
Code:

telnet 192.168.2.1 53
Try to use the DNS server from your provider.


Do you have a connection from the other client on 192.168.1.119 ?
If yes, how is the network configured on that computer?

metacym 04-12-2009 07:21 AM

Quote:

Originally Posted by repo (Post 3506276)
Is there a DNS server configured at 192.168.2.1 ?
what is the output from
Code:

telnet 192.168.2.1 53
Try to use the DNS server from your provider.


Do you have a connection from the other client on 192.168.1.119 ?
If yes, how is the network configured on that computer?

telnet must not be emerged or something. doesnt yield any results.

there is a dns server at 192.168.2.1, it is the IP address for ethernet-sharing on the macbook pro. 192.168.1.119 is the macbook pro's own IP address on the LAN.

the macbook pro is wirelessly connected to a wrt150N Linksys, which is connected to a comcast cable-internet router.


Cable Internet

|
v

linksys
192.168.1.1
wifi

|
v

macbookproserver
192.168.1.119
eth-sharing
192.169.2.1

|
v

Gentoo Box
192.168.2.120

repo 04-12-2009 07:26 AM

you are connected with a wire to the macpro, right?

what is the output from

Code:

nslookup www.google.be


All times are GMT -5. The time now is 11:35 PM.