Linux Basic Network Building experiment

Source: Internet
Author: User

first, the experimental target

Use 3 virtual machines, build Vmnet2 and Vmnet3 two host-only network, realize interconnection between two networks

second, the experimental environment
Intranet External network 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

third, the experimental steps

1, add VMnet2 and VMnet3, and cancel its DHCP function

2, intranet virtual machine settings

(1) solve the problem of Nic inconsistency, set static IP, subnet mask and gateway for it

[[Email protected] Desktop]# gedit/etc/sysconfig/network-scripts/ifcfg-eth0//edit NIC Information

(2) Add intranet virtual machine to VMnet2

(3) Restart Network Service

[Email protected] Desktop]# service network restart

(4) To see if the IP address of the set is obtained

[[Email protected] Desktop]# ifconfig

2, external network virtual machine settings

Solve the problem of network card inconsistency, set the static IP, subnet mask and gateway for it, and add it to VMnet3, and set up the operation with the intranet virtual machine.

3. Setting up the Gateway virtual machine

(1) Add a network card for the gateway virtual machine, and set its two cards to belong to the networks, add eth0 join Vmnet2,eth1 join VMNET3

(2) solve the problem of inconsistent two NIC, set the static IP, subnet mask and gateway respectively

(3) Turn on forwarding function

[[Email protected] Desktop]# gedit/etc/sysctl.conf//Open System parameters configuration file
[[Email protected] Desktop]# sysctl-p//Make configuration file effective
[[Email protected] Desktop]# servcie iptables stop//temporarily turn off firewall

Iv. test of results

In the intranet virtual machine ping outside the network virtual machine, found that can ping through!

202.3. 4.10

Linux Basic Network Building experiment

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.