Ubuntu network settings

Source: Internet
Author: User
Tags crypt

 

 

# Sort by online materials <br/> # method 1 and method 4 verified <br/> # Anything the matter, please contact: asksamuel@sina.com </P> <p> directory <br/> Method 1: The network adapter automatically obtains the IP address through DHCP <br/> Method 2: static network adapter IP Address Allocation <br/> method 3: pppoe broadband dialing configuration <br/> Method 4: connect to the Internet through a wireless LAN </P> <p> Method 1: the network adapter automatically obtains the IP address through DHCP <br/> $ sudo gedit/etc/Network/interfaces <br/> # modify the file/etc/Network/interfaces in the following text </P> <p> # ------------------------------------------------------------------------------- <br/> # This file Describes the network interfaces available on your system <br/> # And how to activate them. for more information, see interfaces (5 ). <br/> # The loopback network interface (configure the loopback interface) <br/> auto lo # boot auto lo interface <br/> iface lo Inet loopback # configure the lo interface as the loopback port <br/> # the primary network interface (configure the master Network) interface) <br/> auto eth0 # enable eth0 interface automatically upon startup <br/> iface eth0 Inet DHCP # configure the eth0 interface to automatically obtain DHCP <br/> #----------------------- -------------------------------------------------------- </P> <p> $ sudo/etc/init. d/networking restart # restart the Network </P> <p> Method 2: nic static allocation IP address <br/> $ sudo gedit/etc/Network/interfaces <br/> # modify the file/etc/Network/interfaces in the following text </P> <p> # usage <br/> # This file describes the network interfaces available on your system <br/> # And how to activate th Em. for more information, see interfaces (5 ). <br/> # The loopback network interface (configure the loopback interface) <br/> auto lo # boot auto lo interface <br/> iface lo Inet loopback # configure the lo interface as the loopback port <br/> # the primary network interface (configure the master Network) interface) <br/> auto eth0 # enable the eth0 interface automatically upon startup <br/> iface eth0 Inet static # configure the eth0 interface to set a static IP address <br/> address 10.16.3.99 <br/> netmask 255.255.255.255.0 <br/> network 10.16.3.0 <br/> broadcast 10.16.3.255 <br/> Gateway 10.16.3.1 <br/> ################################### ################ <br/> # DNS-* options are implemented by the resolvconf package, if installed (DNS settings) <br/> # DNS-nameservers 61.153.177.196 61.153.177.197 <br/> # DNS-search fireteam.org <br/> ################# ###################################< br/> # sudo gedit/etc/resolv. conf <br/> # Set DNS server (multiple DNS servers can be set) <br/> # nameserver 192.168.1.1 <br/> ########### ######################################## # <Br/> # ------------------------------------------------------------------------------- </P> <p> $ sudo/etc/init. d/networking restart # restart the Network </P> <p> method 3: pppoe broadband dialing configuration <br/> initial Dialing: <br/> application-System Tools-terminal open a terminal and enter the following command: <br/> sudo pppoeconf <br/> the system starts searching for ADSL modem on all network interfaces, step by step. </P> <p> │ please enter the username which you usually need for │ <br/> │ the PPP login to your provider in the input box below. │ <br/> │ if you wish to see the help screen, delete the │ <br/> │ username and press OK. │ </P> <p> enter your bandwidth account. <Br/> enter the password. </P> <p> tip: For a pppoe broadband account provided by Henan Netcom, enter the encrypted user name </P> <p> wocould you like to add these addresses automatically to the list of nameservers <br/> in your local/etc/resolv. CONF file? (Recommended) <br/> whether to automatically obtain the DNS. Select Yes. </P> <p> shocould pppoe clamp MSS at 1452 bytes? If unsure, say yes. <br/> set the packet length. If you are not sure about the length, select </P> <p> your pppd is configured now. wocould you like to start the connection at <br/> boot time? <Br/> is ADSL automatically activated at startup? Let's take a look. </P> <p> after dialing, open the terminal and enter the following command: <br/> sudo Pon DSL-provider </P> <p> generally, after one dial, the system will automatically dial the Internet after logging on to Ubuntu. You do not need to enter the command to dial each time. </P> <p> manual disconnection: <br/> sudo poff </P> <p> check the connection status: <br/> plog and ifconfig ppp0 </P> <p> ifconfig ppp0 can query the local IP address. </P> <p> Method 4: connect to the Internet through a wireless LAN </P> <p> requires the installation of a wireless LAN with a drive <br/> 1. insert a wireless network adapter <br/> to check network settings and whether two devices are added </P> <p> $ ifconfig <br/> eth0 link encap: Ethernet hwaddr 00: 24: 7e: 14: A9: A8 <br/> inet6 ADDR: fe80 :: 224: 7eff: fe14: a9a8/64 scope: link <br/> up broadcast running Multicast MTU: 1500 Metric: 1 <br/> RX packets: 11998024 errors: 0 dropped: 0 overruns: 0 frame: 0 <br/> TX packets: 13667166 errors: 0 dropped: 0 overruns: 0 carrier: 0 <br/> Collisions: 0 txqueuelen: 100 <br/> RX Bytes: 1069420740 (1.0 GB) TX Bytes: 3776606487 (3.7 GB) <br/> memory: fc200000-fc220000 </P> <p> eth0: avahi link encap: Ethernet hwaddr 00: 24: 7e: 14: A9: A8 <br/> Inet ADDR: 169.254.7.73 bcast: 169.254.425255 mask: 255.255.0.0 <br/> up broadcast running Multicast MTU: 1500 Metric: 1 <br/> memory: fc200000-fc220000 </P> <p> lo link encap: local loopback <br/> Inet ADDR: 127.0.0.1 mask: 255.0.0.0 <br/> inet6 ADDR: 1/128 scope: Host <br/> up loopback running MTU: 16436 Metric: 1 <br/> RX packets: 66657 errors: 0 dropped: 0 overruns: 0 frame: 0 <br/> TX packets: 66657 errors: 0 dropped: 0 overruns: 0 carrier: 0 <br/> Collisions: 0 txqueuelen: 0 <br/> RX Bytes: 6372151 (6.3 MB) TX Bytes: 6372151 (6.3 MB) </P> <p> ppp0 link encap: point-to-Point Protocol <br/> Inet ADDR: 123.10.130.147 p-t-P: 123.10.128.1 mask: 255.255.255.255 <br/> up pointopoint running noarp multicast MTU: 1492 Metric: 1 <br/> RX packets: 149828 errors: 0 dropped: 0 overruns: 0 frame: 0 <br/> TX packets: 122796 errors: 0 dropped: 0 overruns: 0 carrier: 0 <br/> Collisions: 0 txqueuelen: 3 <br/> RX Bytes: 150170347 (150.1 MB) TX Bytes: 16349467 (16.3 MB) </P> <p> wlan0 link encap: Ethernet hwaddr 00: 22: Fa: 94: 48: 56 <br/> up broadcast multicast MTU: 1500 Metric: 1 <B R/> RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0 <br/> TX packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0 <br/> Collisions: 0 txqueuelen: 1000 <br/> RX Bytes: 0 (0.0 B) TX Bytes: 0 (0.0 B) </P> <p> wmaster0 link encap: unspec hwaddr ready-<br/> 00-00 <br/> up broadcast running Multicast MTU: 1500 Metric: 1 <br/> RX packets: 0 errors: 0 dropped: 0 overruns: 0 frame: 0 <br/> T X packets: 0 errors: 0 dropped: 0 overruns: 0 carrier: 0 <br/> Collisions: 0 txqueuelen: 1000 <br/> RX Bytes: 0 (0.0 B) TX Bytes: 0 (0.0 B) </P> <p> If you see eth0, it indicates that the NIC device has been set. eth0 is the name of the wireless Nic device. For other devices, I will not study it for the moment. </P> <p> 2. confirm the model of the wireless network adapter <br/> $ lspci <br/> ...... <br/> 00: 19. 0 Ethernet controller: Intel Corporation 82567lm gigabit network <br/> connection (Rev 03) <br/> ...... </P> <p> the above Intel Corporation 82567lm gigabit network connection (Rev 03) is the model of the wireless Nic chip <br/>. </P> <p> 3. power on the wireless network adapter <br/> $ sudo iwconfig eth0 txpower on </P> <p> 4. retrieve wireless networks in a region <br/> $ iwlist eth0 scan <br/> eth0 scan completed: <br/> cell 01-Address: 00: 1D: 0f: 4d: 8b: e4 <br/> Essid: "TP-LINK" <br/> mode: Master <br/> frequency: 2.437 GHz (Channel 6) <br/> Quality = 28/70 signal level =-67 dBm noise level =-95 dBm <br/> encryption key: Off <br/> bit rates: 1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s <br/> 12 Mb/s; 24 m B/S; 36 Mb/s; 9 Mb/s; 18 Mb/s <br/> 48 Mb/s; 54 Mb/s <br/> extra: bcn_int = 100 <br/> extra: ath_ie = dd0900037f01010008ff7f <br/> cell 02-Address: 00: 21: 27: 3A: 37: 0a <br/> Essid: "TP-LINK" <br/> mode: master <br/> frequency: 2.437 GHz (Channel 6) <br/> Quality = 12/70 signal level =-83 dBm noise level =-95 dBm <br/> encryption key: on <br/> bit rates: 1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s <br/> 12 Mb/s; 24 Mb/s; 36 m B/S; 9 Mb/s; 18 Mb/s <br/> 48 Mb/s; 54 Mb/s <br/> extra: bcn_int = 100 <br/> extra: ath_ie = dd0900037f01010008ff7f <br/> cell 03-Address: 00: 18: 39: A6: 98: E2 <br/> Essid: "Linksys" <br/> mode: master <br/> frequency: 2.437 GHz (Channel 6) <br/> Quality = 3/70 signal level =-92 dBm noise level =-95 dBm <br/> encryption key: on <br/> bit rates: 1 Mb/s, 2 Mb/s, 5.5 Mb/s, 11 Mb/s, 6 Mb/s <br/> 9 Mb/s, 12 Mb/s, 18 Mb/s, 24 MB/ S; 36 Mb/s <br/> 48 Mb/s; 54 Mb/s <br/> extra: bcn_int = 100 <br/> ie: WPA version 1 <br/> group cipher: CCMP <br/> pairwise ciphers (1): CCMP <br/> authentication suites (1): PSK </P> <p> I have three wireless APS nearby, essid is marked by the Wireless AP name, of which two Wireless AP are called TP-LINK, the other is called <br/> Linksys, write down the names of the Wireless AP, will have to try one. </P> <p> 5. connect to a Wireless AP <br/> $ sudo iwconfig ATH0 Essid "Linksys" <br/> $ ifconfig </P> <p> no message is displayed whether connected or not, you still need to run the command to check whether the connection is connected. <br/> $ iwconfig eth0 <br/> eth0 IEEE 802.11g Essid: "Linksys" nickname: "" <br/> mode: managed frequency: 2.462 GHz Access Point: Not-associated <br/> bit rate: 0 kb/s TX-power: 18 dBm sensiti.pdf = 1/1 <br/> retry: Off RTS thr: Off fragment thr: Off <br/> power management: Off <br/> link quality = 0/ 70 signal level =-95 dBm noise level =-95 dBm <br/> RX invalid nwid: 8172 RX invalid crypt: 0 RX invalid frag: 0 <br/> TX excessive retries: 0 invalid MISC: 0 missed Beacon: 0 </P> <p> the section in the black text above indicates that no connection is successful. It doesn't matter if you change another one. </P> <p> $ sudo iwconfig eth0 Essid "TP-LINK" <br/> $ ifconfig </P> <p> check the access status after execution <br/> $ iwconfig eth0 <br/> eth0 IEEE 802.11g Essid: "TP-LINK" nickname: "" <br/> mode: managed frequency: 2.437 GHz Access Point: 00: 1D: 0f: 4d: 8B: e4 <br/> bit rate: 36 Mb/s TX-Power: 18 dBm sensitivity = 1/1 <br/> retry: Off RTS thr: Off fragment thr: Off <br/> power management: off <br/> link quality = 26/70 signal level =-69 dBm Noise Level =-95 dBm <br/> RX invalid nwid: 8268 RX invalid crypt: 0 RX invalid frag: 0 <br/> TX excessive retries: 0 invalid MISC: 0 missed Beacon: 0 </P> <p> OK. It is connected. </P> <p> Note: If you need a password to connect to the AP and you do know the password, you can use the following method to connect to the AP <br/> assume that the password is 123456789, the password must be separated by a group of four digits. </P> <p> $ sudo iwconfig ATH0 Essid "TP-LINK" Key 1234-5678-9 </P> <p> 6. enable wireless network adapter <br/> $ sudo ifconfig ATH0 up </P> <p> 7. set the wireless network adapter to automatically obtain the IP address using DHCP <br/> $ sudo dhclient ATH0 <br/> Internet Systems Consortium DHCP Client v3.0.6 <br/> Copyright 2004-2007 Internet Systems Consortium. <br/> All Rights Reserved. <br/> for info, please visit http://www.isc.org/sw/dhcp/ </P> <p> wifi0: Unknown hardware address type 801 <br/> wi Fi0: Unknown hardware address type 801 <br/> listening on LPF/ATH0/00: 19: E0: 85: 73: 70 <br/> sending on LPF/ATH0/00: 19: E0: 85: 73: 70 <br/> sending on socket/fallback <br/> dhcpdiscover on ATH0 to 255.255.255 port 67 interval 6 <br/> dhcpoffer of 192.168.1.104 from 192.168.1.1 <br/> dhcprequest of 192.168.1.104 on ATH0 to 255.255.255.255 port 67 <br/> dhcpack of 192.168.1.104 from 192.168.1.1 <br/> bound t O 192.168.1.104 -- renewal in 3125 seconds. </P> <p> now you can unplug the network cable and use the wireless network card to access the Internet. </P> <p> 8. Disconnect the Network <br/> to disconnect the network, run the following command: <br/> $ sudo ifconfig ATH0 down

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.