How to connect to Wired internet connection through terminal?
13
I am using Ubuntu 10.04 with KDE on it.
I am facing a problem in connecting to wired LAN internet connection.
Can any one tell me the procedure on how to connect to wired LAN internet connection through terminal..
I want to connect to wired internet connection with static IP and authentication.
add a comment
5
All the details you need should be found here: http://www.ubuntugeek.com/ubuntu-networking-configuration-using-command-line.html
- 15Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference. – Eliah Kagan Aug 11 '12 at 22:05
- 3-1 answers containing only a link are volatile and against the rules of the site. I hope this down vote convinces you to follow the site rules – Braden Best Jun 27 '16 at 15:18
17
This is just a modified version of: http://www.ubuntugeek.com/ubuntu-networking-configuration-using-command-line.html
How to configure the network interface using the terminal
You can configure a network interface from the command line using the networking utilities. You configure your network client hosts with the command line by using commands to change your current settings or by editing a number of system files. To configure your network interface card to automatically connect when wired cable is connected you can follow this "simple" steps:
- Configuring DHCP address for your network cardTo configure DHCP address, edit the
/etc/network/interfacesand enter the following lines replacingeth0in the example with your network interface card:sudo nano /etc/network/interfacesYou should see something similar to this:auto eth0 iface eth0 inet dhcpin my computer it looks like this:auto lo iface lo inet loopbackSo if your network card appears aseth2for example then you would leave the file like this:auto eth2 iface eth2 inet dhcp - Just in case you want to configure a static IP address for your network cardSame procedure as above but you would need to include more information.Like above, replace
eth0with your networks card name:sudo nano /etc/network/interfacesExample File:auto eth0 iface eth0 inet static address 192.168.0.100 gateway 192.168.0.1 netmask 255.255.255.0 network 192.168.0.0 broadcast 192.168.0.255After entering all the details which are needed for your static IP you would need to restart networking services using the following command:sudo /etc/init.d/networking restart - Setting up DNSYou can add hostname and/or IP addresses to the file
/etc/hostsfor static lookups.To cause your machine to consult with a particular server for name lookups you simply add their addresses to/etc/resolv.conf.For example a machine which should perform lookups from the DNS server at IP address 192.168.0.1 would have aresolv.conffile looking like this:sudo nano /etc/resolv.confsearch test.com nameserver 192.168.0.1in my case it looks like this:search cantv.net nameserver 127.0.0.1
2
most answers on this issue are most likely to confuse readers when demostrating what to put in the
/etc/resolv.conf because they use local addresses for the nameserver.
"For example a machine which should perform lookups from the DNS server."
Here DNS server and nameserver mean the same thing. So instead of placing a LAN address in there, put an actual DNS server address. (ie. Google DNS server)
nameserver 8.8.8.8
this link explains the used of the resolv.conf file in more depth. https://theos.in/desktop-linux/resolve-conf-linux-example/
Not the answer you're looking for? Browse other questions tagged command-line internet lan wiredor ask your own question.
asked
|
8 years, 2 months ago
|
viewed
|
146,328 times
|
active
|
Hot Network Questions
- Clarifying the benefits of the Alert feat over Find Familiar
- Why check your email in haveibeenpwned rather than regularly changing your password regardless of any leaks?
- Mistakes in Bredon's book "Topology and Geometry"?
- Fair rent to pay for partial owner occupied apartment
- Why is mustard irritating for me?
- Draw a path made by direction changers
- Why would someone get a fine when using a disabled parking space when the disabled person is not in the car?
- Does YouTube delete video dislikes?
- Microcontroller shelf life
- What is capitalism's answer to constant economic growth hitting the limit of the planet's finite resources?
- Is apt dist-upgrade not necessary anymore
- Is the uniqueness of the additive neutral element sufficient to prove x+z=x implies z=0?
- Joining two wires into a single breaker
- GPS when flying over the ocean
- Requesting a Letter of Recommendation—did I do something wrong?
- Distribute an integer amount by a set of slots as evenly as possible
- Examples of when the professional scientists or mathematicians were wrong, but the nonprofessionals were right?
- Brit Milah on 8th day v/s delays
- How does PKCS 1.5 solve the insecureness of Textbook RSA?
- Why didn’t the Captain of Cathay Pacific flight 780 shut down engine 1 and land with a more reasonable speed?
- What can I do with a property that won't sell following divorce?
- Coworker watches content on his phone all day
- Is there a word used to describe a weekend plus a one-day holiday?
- Yo-yo as weapon