Internet screwed up from ifconfig
I did something like this just a little while ago to change my IP address
Code:
sudo ifconfig eth0 192.168.0.120 netmask 255.255.255.0 up BTW, when I open Firefox, it pops up an error saying that it couldnīt connect to the internet. Hereīs kinda what iconfig says. Code:
# ifconfig eth0 here is my network info that I want to be static: IP: 192.168.0.120 (router is default 192.168.0.1) Mask: 255.255.255.0 Any help will be greatly appreciated and I apologize if this has been asked before (I searched a lot). |
http://textsnippets.com/posts/show/319
Just use sudo nano /etc/network/interfaces and use the address 192.168.0.120 instead of 192.168.0.100 in the link above... Then you should just have to do sudo ifdown eth0 and sudo ifup eth0 to restart the network. Or use /etc/init.d/networking restart (I just found this command)... |
I did what you said, pljvaldez, and I got this:
Quote:
|
Can you post your /etc/network/interfaces?
|
Quote:
BTW, ipconfig doesnīt work. Itīs not installed, but I guess using ifconfig works too. I rebooted my PC just in case, but no difference. |
ipconfig is a windows command. In linux, it's ifconfig. Hmmmm. That's odd that it didn't work for your setup. It looks like the settings didn't take. That's why I was curious to see the output of the file. To see if maybe there's a typo or something...
Do you have DHCP on your network that you can use? If so, sometimes the router will allow you to do "static DHCP" which is to assign an IP based on the MAC address of your card. Then the machine can continue to use DHCP, but it will always get the same address. |
Here is a screenshot of it http://cory.mensajerofm.org/images/dhcp.jpg
|
From what I can tell, no static IP option for you...
I guess when you get home, post your /etc/network/interfaces and we can go from there... |
OK. I got it fixed with some help at ubuntuforums.org
Here is what I did: Code:
sudo nano /etc/resolv.conf Code:
nameserver [nameserver IP #1] Code:
sudo ifconfig eth0 192.168.0.120 netmask 255.255.255.0 up sudo route add default gw 192.168.0.1 Code:
ping 192.168.0.1 |
Ok, now I have a problem because when I reboot the /etc/resolv.conf get's overwritten and I have to enter the commands every time I reboot my PC. How can I make it do it automatically every time I boot?
|
Did you disable the dhcp client?
|
All times are GMT -5. The time now is 09:55 AM. |