Static IP (private) not working
Hello,
I have set a static local IP address for my machine, but after that I can't get on the internet. I'm running openSuSE 11.0 with a Broadcom card on a laptop. Usually my settings are set to DHCP which always assigned me to the local address 192.168.1.6. But recently the router gave me a new private IP address, which means I have to update all the port forwarding rules. But I want to avoid that by setting 192.168.1.6 as my static IP. Internet works fine when set to DHCP, but when I use "yast2 lan" to change to a static IP, I can't get on the internet. I used the following settings to set it to static: Local static IP: 192.168.1.6 (this ip is not in use, and i tried other ip's also) Subnetmask: 255.255.255.0 (which is the same when DHCP is enabled) DNS/Nameserver: 192.168.1.1 (which is also the same when DHCP is enabled) When I do an ifconfig afterwards, the ip is indeed set to the new address. But websites still can't be found. Anyone got an idea how to fix this? |
# cat /etc/resolv.conf
? It's not clear whether you're saying you can't connect to the 'net or whether you simply can not resolve names. If resolve.conf does not contain nameservers when you set a static IP, there's your problem. |
Quote:
I don't really know what you mean by "can't resolve names", but i just found something weird when viewing the contents of '/etc/resolve.conf'. When DHCP is enabled: Code:
# generated by NetworkManager, do not edit! Code:
# generated by NetworkManager, do not edit! How do I fix this without manually editing the file? I prefer to use graphical tools to set these things rather then manually editing things. |
You could probably have your dhcp serve assign a specific IP based on the MAC address as well - same result, less fiddling
Edit cross typing I see. |
Probably from network manager would be my guess.
|
Ok, I just set the nameserver with the same network manager, and this is what I got:
# cat /etc/resolv.conf When DHCP is enabled and internet is working: Code:
nameserver 192.168.1.1 Code:
domain site About "assigning a specific IP based on the MAC address". I just went through all my router settings, but there is no such option :( |
What IP are you assigning, is it 192.168.1.6?
From the command line, can you post the results of: ifconfig route dig www.google.com You will probably need to be root or use sudo. |
1- ping your gateway, if it pings, go to next step, if not, you have a network problem.
2- ping external ip (4.2.2.2), if it pings, go to next step, if not, you have a routing problem. 3- add external dns server to your /etc/resolv.conf (internet dns servers 4.2.2.2, 142.77.1.1) heloma. |
Yes, I'm assigning 192.168.1.6
When DHCP is enabled: Code:
saibot:~ # ifconfig Code:
saibot:~ # ifconfig |
Ok, so when you use DHCP, the default route is via eth0, but through wlan0 otherwise. However dig (that's a namserver lookup) works because it's being routed through eth0 because it's on 192.168.1.1 (see first line of route output).
Am I correct in saying that you are both wired in and trying to use your wireless card? It looks to me like th wireless card isn't working properly if that's the case. |
I think I should have disabled my wlan in the previous step. I redid the same step, but this time with wireless disabled:
When DHCP is disabled: Code:
saibot:~ # ifconfig Code:
saibot:~ # ping 192.168.1.1 Quote:
|
Yes. What distro are you using?
|
Quote:
|
Sorry, running a few responses in tandem here. Let me have a look at my OpenSuSe box and come back to you.
|
When you open up Network Settings from yast, there's a routing tab on the RHS.
You need to add 192.161.1.1 as the default gateway. |
All times are GMT -5. The time now is 04:40 AM. |