Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
# 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.
What I meant whas, I can't access websites, or use Skype, or anything that uses the internet. A simple 'ping google.com' doesn't work either.
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!
nameserver 192.168.1.1
When DHCP is not enabled:
Code:
# generated by NetworkManager, do not edit!
So it's missing one line: "nameserver 192.168.1.1"
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.
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)
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.
Last edited by billymayday; 11-18-2008 at 04:13 PM.
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
eth0 Link encap:Ethernet HWaddr 00:15:F2:38:43:9B
inet addr:192.168.1.6 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::215:f2ff:fe38:439b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:6486 errors:0 dropped:0 overruns:0 frame:0
TX packets:6335 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3282799 (3.1 Mb) TX bytes:1292303 (1.2 Mb)
Interrupt:19 Base address:0xc00
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:4896 errors:0 dropped:0 overruns:0 frame:0
TX packets:4896 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:263192 (257.0 Kb) TX bytes:263192 (257.0 Kb)
saibot:~ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
loopback * 255.0.0.0 U 0 0 0 lo
saibot:~ # dig www.google.com
; <<>> DiG 9.4.2-P1 <<>> www.google.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19441
;; flags: qr rd ra; QUERY: 1, ANSWER: 5, AUTHORITY: 0, ADDITIONAL: 0
;; QUESTION SECTION:
;www.google.com. IN A
;; ANSWER SECTION:
www.google.com. 604041 IN CNAME www.l.google.com.
www.l.google.com. 146 IN A 74.125.79.147
www.l.google.com. 146 IN A 74.125.79.104
www.l.google.com. 146 IN A 74.125.79.103
www.l.google.com. 146 IN A 74.125.79.99
;; Query time: 31 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Tue Nov 18 23:01:19 2008
;; MSG SIZE rcvd: 116
And in response to heloma:
Code:
saibot:~ # ping 192.168.1.1
PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
64 bytes from 192.168.1.1: icmp_seq=1 ttl=64 time=1.10 ms
64 bytes from 192.168.1.1: icmp_seq=2 ttl=64 time=1.02 ms
64 bytes from 192.168.1.1: icmp_seq=3 ttl=64 time=0.942 ms
64 bytes from 192.168.1.1: icmp_seq=4 ttl=64 time=0.936 ms
^C
--- 192.168.1.1 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3011ms
rtt min/avg/max/mdev = 0.936/1.003/1.108/0.070 ms
saibot:~ # ping 4.2.2.2
connect: Network is unreachable
saibot:~ # ping 82.173.xxx.xx (my public ip)
connect: Network is unreachable
saibot:~ #
So that means it's a routing problem?
Quote:
Originally Posted by billymayday
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.
Yes, it is true that both wireless and cable were enabled. But wireless works fine when DHCP is enabled. Wireless works very slow when DHCP is disabled for cable only. I am just trying to set a static IP for cable, not wireless.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.