Jump to content

Static IP versus DHCP [solved]


dlfuller
 Share

Recommended Posts

DHCP Internet access works fine with Community 10.1 and DHCP on my SMB network.

 

The small network includes Macs and PCs (Windows) with the internet connection through wired ethernet, router (firewall), then a cable modem. The router provides DHCP.

 

I would like to use my 10.1 computer as an occasional SMB server. For that it seems best to switch it to a fixed IP address. SMB sharing and mounting still work well, but I can no longer access the internet from that computer.

 

Is there a simple way around this, maintaining internet access while using a static IP address? It's convenient to access the internet directly on this computer and not have to use one of the others on the network.

 

--Don

Link to comment
Share on other sites

Have a look at the 'simple net setup' howto listed in the pinned topic right at the top of the networking forum. It's title is sharing internet connections, but there is a link to this howto - follow the assigning static addresses link.

 

Good luck!

 

Chris

Link to comment
Share on other sites

When you allocated the static IP address, did you also allocate DNS Servers for the internet connection and default gateway?

 

I use static through an ethernet firewall, which then goes to an ethernet port on my router which runs the internet connection.

 

My default router is the ethernet firewall, and the DNS servers are from the ISP I use. For you, your default gateway is going to be your router (I'm assuming your wired ethernet is a hub/switch and nothing else).

 

As an example:

 

Static IP 192.168.1.5

Subnet 255.255.255.0

Default Gateway 192.168.1.1 (router)

DNS - ISP provided. (I have two)

 

Set your hostname to anything you like, leave search domain and zeroconf fields blank.

Link to comment
Share on other sites

Thank you Gentlemen. Your suggestions were right on.

 

The background here is the DNS servers are provided automatically by my ISP (Comcast). Their simple setup is to select DHCP and provide the correct (registered) MAC address for the router. Then everything else is automatic with no more entries required. So I was unaware of DNS addresses. The setup just worked.

 

The howto explained concepts and led to verification in logical steps. And, after I added the gateway and DNS addresses, everything worked fine with my static IP address. There had been no gateway addresses before.

 

The simple part was that the DNS servers were already there in MCC > Network & Internet > Manage connections since I had been successfully using DHCP. All I did was enter my preferred static IP and the missing Gateway addresss and everything just worked -- browsing the internet and LAN serving.

 

In the end, I did opt for a different approach by changing from a Linksys to a Netgear router. Netgear offers "Address Reservation" in their LAN IP setup. You assign an IP address and device name based on a MAC address. If the computer is on the LAN as it would be if you first set it up as DHCP, then most of an entry is already available to be added or edited. Makes it easy. The advantage for me is centralized control at a LAN DHCP server for both DHCP and static IP addresses on the LAN in one place.

 

Thanks again for your help.

Link to comment
Share on other sites

Guest alkmie
Thank you Gentlemen.  Your suggestions were right on.

 

 

The howto explained concepts and led to verification in logical steps.  And, after I added the gateway and DNS addresses, everything worked fine with my static IP address.  There had been no gateway addresses before.

 

The simple part was that the DNS servers were already there in MCC > Network & Internet > Manage connections since I had been successfully using DHCP.  All I did was enter my preferred static IP and the missing Gateway addresss and everything just worked -- browsing the internet and LAN serving.

 

 

Thanks again for your help.

 

im am using mandriva 10.2 LE

 

and when i use mcc to switch ip to static i set the default gateway to my router click apply and for some reason it does not save the router setting??

 

what file is mcc editting to set the defualt gateway (192.168.0.1 in this case)?

 

ive looked in /etc/sysconfig/networking/eth0

 

 

network = 192.168.0.0

broadcasts = 192.168.0.225

 

any ideas?

Link to comment
Share on other sites

what file is mcc editting to set the defualt gateway (192.168.0.1 in this case)?

 

ive looked in /etc/sysconfig/networking/eth0

You were close. It's the /etc/sysconfig/network file.

 

Example entries:

 

HOSTNAME=MY.HOSTNAME

NETWORKING=yes

GATEWAY=192.168.1.1

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...