Set a fixed IP address under ubuntulinux (applicable to both PC and virtual machines)
Source: Internet
Author: User
Set up a fixed IP address under ubuntulinux (applicable to both PC and virtual machines) platform: ubuntu12.1032/64bit (or ubuntu12.10 installed on the VM) cause: assign a fixed ip address as needed. The bird is embarrassed to ask about the network management. it can be divided into two parts by following the steps below: graphics... set a fixed IP address in ubuntu linux (applicable to both PC and virtual machines) platform: ubuntu12.10 32/64 bit (or ubuntu12.10 installed on the VM) cause: assign a fixed ip address as needed. The bird is embarrassed to ask about the network management. you can complete the following steps: graphical interface modification and command line modification. you can choose either of them. note: 1. the premise of modifying a fixed IP address in this article is: note: 2. the system running on the VM must use the Network selection bridge link in Setting to modify the graphical interface 1. open the edit connection in ubuntu (the default link should be edited for wireless networks) 2. change the IPv4 address to "manual" 3. add the [plain] Address: 192.168.1.20 subnet mask: 255.255.255.0 Gateway: 192.168.1.1 preferred DNS server: (DNS of the province and city where Baidu is located, open the router to view or directly use 192.168.1.1) backup DNS server: 192.168.1.1 4. check the IPv4 address to complete the connection and save it. After completing the above steps under StartX, you can access the Internet by using the command line (Wireless has not been tried, but regardless of Wired Wireless, the system running on the VM is wired) 1. edit the file: [plain] $ sudo vi/etc/NetworkManager. conf modification: the managed parameter is true. if it is fault, a message saying "the wired network device is not hosted ". 2. modify the IP settings and edit the file [plain] $ sudo vi/etc/network/interfaces auto lo iface lo inet loopback: auto eth0 iface eth0 inet static address 192.168.1.20 netmask 255.255.255.0 gateway 192.168.1.1 save, so that the IP address does not take effect immediately. Run $ sudo/etc/init. d/networking restart to ping the computer on the LAN. But cannot access the Internet because DNS is not set. 3. modify DNS and edit the file: [plain] $ sudo gedit/etc/resolv. add conf: nameserver (DNS of Baidu's province and city, open vro to view or directly use 192.168.1.1) nameserver 192.168.1.1 save and close. restart the NIC to make the settings take effect: $ sudo/etc/init. d/networking restart command line to complete the above steps, you can access the Internet with the Nic settings related commands: [plain] to view the Nic information: ifconfig to set a nic ip: ifconfig eth1 192.168.1.20 netmask restart 255.255.0 restart the NIC to make the settings take effect: sudo/etc/init. d/networking restart change MAC address: ifconfig eth0 hw ether xx: xx View route information: route-n
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.