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: graphic interface modification and command line modification. Select either of them.
Note: 1. The premise for modifying a fixed IP address in this article is that the network cable is routed to the PC through the router.
Note: 2. The system running on the VM must use the network in setting to select the bridge link.
Graphic Interface Modification
1. Open the edit connection In ubuntu (to edit the default link for wireless networks)
2. Change the IPv4 address to "Manual"
3. Add
[Plain]View plaincopy
- 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, access the router, 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.
Go online after completing the above steps under startx
Command Line Modification (Wireless has not been tried, but regardless of Wired wireless, the system running on the VM is wired)
1. edit the file:
[Plain]View plaincopy
- $ Sudo VI/etc/NetworkManager. conf
Modify: the value of managed is true.
If it is fault, the system will prompt "the wired network device is not hosted ".
2. Modify the IP settings and edit the file:
[Plain]View plaincopy
- $ Sudo VI/etc/Network/interfaces
- Auto Lo
- Iface lo Inet loopback
- Add:
- 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. Need to execute
$ Sudo/etc/init. d/networking restart
At this time, you can ping the computer in the LAN. But cannot access the Internet because DNS is not set.
3. Modify DNS and edit the file:
[Plain]View plaincopy
- $ Sudo gedit/etc/resolv. conf
- Add:
- Nameserver (DNS of Baidu's province and city, open the router 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
Use the command line to access the Internet.
Attached Nic settings commands:
[Plain]View plaincopy
- View Nic information: ifconfig
- Set a nic ip Address: ifconfig eth1 192.168.1.20 netmask 255.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
Original article: http://blog.csdn.net/saviourxx/article/details/8702821