LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 04-12-2009, 02:06 AM   #1
metacym
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Rep: Reputation: 0
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
 
Old 04-12-2009, 03:44 AM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
network 192.168.2.1
shouldn't this be
Quote:
network 192.168.1.0
Can you ping
192.168.1.118 ?
 
Old 04-12-2009, 04:01 AM   #3
metacym
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 04-12-2009, 04:07 AM   #4
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
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
 
Old 04-12-2009, 04:21 AM   #5
metacym
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
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" )
 
Old 04-12-2009, 04:28 AM   #6
metacym
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
and no, i cannot seem to ping 192.18.1.118
 
Old 04-12-2009, 05:02 AM   #7
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
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.*
 
Old 04-12-2009, 05:21 AM   #8
metacym
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by repo View Post
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
 
Old 04-12-2009, 05:29 AM   #9
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
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.
 
Old 04-12-2009, 05:38 AM   #10
metacym
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
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.
 
Old 04-12-2009, 06:30 AM   #11
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Can you ping
209.85.227.104
Can you ping
www.google.com

Did you add the correct DNS servers ?
 
Old 04-12-2009, 06:47 AM   #12
metacym
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
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
 
Old 04-12-2009, 06:54 AM   #13
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
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?

Last edited by repo; 04-12-2009 at 07:02 AM.
 
Old 04-12-2009, 07:21 AM   #14
metacym
LQ Newbie
 
Registered: Jan 2009
Posts: 10

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by repo View Post
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
 
Old 04-12-2009, 07:26 AM   #15
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
you are connected with a wire to the macpro, right?

what is the output from

Code:
nslookup www.google.be
 
  


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
Gentoo: switch from static to dhcp samjchoi Linux - Networking 1 03-08-2009 06:14 AM
Cannot setup static IP with openSUSE Fournier Linux - Newbie 2 03-18-2008 06:58 AM
static IP setup problem SRS Linux - Networking 3 07-10-2007 09:27 PM
setup the static ip address hansi umayangan SUSE / openSUSE 1 04-04-2005 02:54 AM
Need help with ethernet setup in Gentoo( During setup proccess) MimiMimi Linux - Distributions 2 07-19-2004 01:34 PM

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

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