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 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
and now I canīt connect to the internet at all. It was really stupid to just do it like that, but I didnīt know how to get a static IP address otherwise (Iīm running Xubuntu). Iīd apreciate any help at the moment (Iīm writing this from another machine on the network) and hope to get this resolved fast.
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
eth0 Link encap:Ethernet HWaddr 00:80:C8:F8:4A:53
inet addr:192.168.0.120 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Interrupt:9 Base address:0x5000
Iīll have to fix this from the command line.
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).
Not really, because Iīm not at home now, but I verified it and I know for a fact that itīs exactly like one in the link you gave me, except for the last part of the IP adress.
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.
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?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.