RedHatLinux vro configuration experiment: Set the Linux server installed with rhel6.1 as a vro to achieve network sharing. Two NICs eth0: internal network eth1: Internet are required. First, describe the network structure Internet: for the company's office network, the IP address of eth1 is 192.168.0.115, and the Intranet of the gateway 192.168.0.1 is a virtual network in the virtual machine architecture. The IP address is 192.168.2.1 gateway 192.168.2.11. /etc/
RedHat Linux router configuration experiment:
Set the Linux server installed with rhel 6.1 As a router to achieve network sharing. Two NICs are required.
Eth0: internal network
Eth1: Internet
First, describe the Network Structure
Internet: office network, eth1 IP address 192.168.0.115, Gateway 192.168.0.1
Intranet: a virtual network in the virtual machine architecture. The IP address is 192.168.2.1, And the gateway is 192.168.2.1.
1./etc/sysconfig/network
NETWORKING = yes
HOSTNAME = manager. localhost # server name
GATEWAY = 192.168.0.1 # Internet GATEWAY
GATEWAYDEV = eth1 # Device Used as the Internet gateway
FORWARD_IPV4 = yes
2. Nic device eth1 Configuration
/Etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE = eth1 # DEVICE code
BOOTPROTO = static # IP Address Configuration Method
IPADDR = 192.168.0.115 # Internet ip Address
TYPE = Ethernet
HWADDR = 00: 0c: 29: 0a: 43: 4d
PEERDNS = yes
ONBOOT = yes # boot
3. Configure eth0 for the Intranet Nic Device
/Etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE = eth0
HWADDR = 00: 0c: 29: 0a: 43: 43
NM_CONTROLLED = yes
ONBOOT = yes
IPADDR = 192.168.2.1 # Intranet ip Address
BOOTPROTO = none
NETMASK = 255.255.255.0
TYPE = Ethernet
GATEWAY = 192.168.0.115 # Intranet GATEWAY, consistent with the Internet ip Address
GATEWAYDEV = eth1 # device that acts as an intranet Gateway
IPV6INIT = no
USERCTL = no
4. Configure iptables
Service iptables stop
Iptables-t nat-a postrouting-o eth0-j MASQUERADE
Iptables-a forward-s 192.168.2.0/24-j ACCEPT
Iptables-a forward-d 192.168.2.0/24-j ACCEPT
Iptables-a forward-s! 192.168.2.0/24-j DROP
Service iptables save # save configuration information
Service iptables start # restart iptables
5. Restart Related Services
Service network restart
Service iptables restart