Linux basic network construction experiment, linux Basic Construction

Source: Internet
Author: User

Linux basic network construction experiment, linux Basic Construction
I. Lab Objectives

Use three virtual machines to build two host-only networks: vmnet2 and vmnet3.

Ii. experiment environment
  Intranet Internet Gateway
IP 192.168.0.10/24 202.3.4.10/24

Eth0: 192.168.0.254/24

Eth1: 202.3.4.254/24

GW 192.168.0.254 202.3.4.254  

 

 

 

 

Iii. Experiment steps

1. Add VMnet2 and VMnet3 and disable their DHCP functions.

2. Intranet Virtual Machine Settings

(1) Solve the Problem of inconsistent network interfaces, and set static IP addresses, subnet masks, and gateways for them.

[Root @ lyy desktop] # gedit/etc/sysconfig/network-scripts/ifcfg-eth0 // edit Nic Information

(2) add an intranet Virtual Machine to VMnet2

(3) restart the network service

[Root @ lyy desktop] # service network restart

(4) check whether the configured IP address is obtained.

[Root @ lyy desktop] # ifconfig

2. Internet Virtual Machine Settings

To solve the problem of inconsistent network adapters, set static IP addresses, subnet masks, and gateways for them, and add them to VMnet3 to perform operations on the same settings as those for Intranet virtual machines.

3. Gateway Virtual Machine Settings

(1) Add a network card for the gateway virtual machine, set the network of the two cards, and add eth0 to VMnet2 and eth1 to VMnet3.

(2) solve the inconsistency between the two NICs by setting static IP addresses, subnet masks, and gateways respectively.

(3) Enable the forwarding function

[Root @ lyy desktop] # gedit/etc/sysctl. conf // open the system parameter configuration file
[Root @ lyy desktop] # sysctl-p // make the configuration file take effect
[Root @ lyy desktop] # servcie iptables stop // temporarily disable the Firewall

Iv. Result Testing

Ping the Internet virtual machine on the Intranet virtual machine and you can Ping it!

[Root @ lyy desktop] # ping 202.3.4.10

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.