vmware 中centos NAT(网络地址转换)安装与使用。
2010-08-20 16:49
183 查看
vmware 中centos NAT(网络地址转换)安装与使用。
NAT的优点
1.减少ip地址使用量
2.可在NAT服务器的外部ip上建立多个ip alias
3.负载平衡。
4.NAT一句作用方向性分两种类型
source NAT (SNAT)所谓的source NAT 就是改变第一个数据包的来源地址。
destination NAT (DNAT)刚好与SNAT相反,它是改变第一个数据包的目的地址如平衡负载就是属于DNAT.
5.vmware中设置两块桥接网卡:
eth0 为wan接口 ip 192.168.10.165 netmask 255.255.255.0 192.168.10.254 dns 202.101.172.35
eth1 为lan接口 ip 192.168.1.1 netmask 255.255.255.0
shell中设置ip用setup 或vi /etc/sysconfig/network-script/ifcfg-eth0//设置WAN的ip地址即可
eth1第二块网卡也是一样的设置只要设置ip地址和子网掩码
6.写一个NAT脚本VI保存chmod 774 nat 或者chmod ug+rwx nat,然后 ./nat运行即可,
把脚本拷贝到cp /etc/rc.d/nat
vi /etc/rc.local
中添加
/etc/rc.d/nat即可启动自动加载脚本。
一下为脚本信息
#! /bin/sh
# this is nat command for NAT
#eth0 lan
#eth1 wan
#start ip_forward
echo 1 >/proc/sys/net/ipv4/ip_forward
#clean default set
iptables -F
iptables -X
iptables -F -t mangle
iptables -t mangle -X
iptables -F -t nat
iptables -t nat -X
#setup filter table default ruler
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
#start NAT
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT --to-source 192.168.10.165
7.客户端windows tcp/ip中设置ip为nat服务器的ip段为192.168.1.2 netmask 255.255.255.0
网关很重要 192.168.1.1为nat服务器的LAN的地址。dns为202.101.172.35。
本文出自 “有志者事竟成!” 博客,请务必保留此出处http://zh888.blog.51cto.com/1684752/380660
NAT的优点
1.减少ip地址使用量
2.可在NAT服务器的外部ip上建立多个ip alias
3.负载平衡。
4.NAT一句作用方向性分两种类型
source NAT (SNAT)所谓的source NAT 就是改变第一个数据包的来源地址。
destination NAT (DNAT)刚好与SNAT相反,它是改变第一个数据包的目的地址如平衡负载就是属于DNAT.
5.vmware中设置两块桥接网卡:
eth0 为wan接口 ip 192.168.10.165 netmask 255.255.255.0 192.168.10.254 dns 202.101.172.35
eth1 为lan接口 ip 192.168.1.1 netmask 255.255.255.0
shell中设置ip用setup 或vi /etc/sysconfig/network-script/ifcfg-eth0//设置WAN的ip地址即可
eth1第二块网卡也是一样的设置只要设置ip地址和子网掩码
6.写一个NAT脚本VI保存chmod 774 nat 或者chmod ug+rwx nat,然后 ./nat运行即可,
把脚本拷贝到cp /etc/rc.d/nat
vi /etc/rc.local
中添加
/etc/rc.d/nat即可启动自动加载脚本。
一下为脚本信息
#! /bin/sh
# this is nat command for NAT
#eth0 lan
#eth1 wan
#start ip_forward
echo 1 >/proc/sys/net/ipv4/ip_forward
#clean default set
iptables -F
iptables -X
iptables -F -t mangle
iptables -t mangle -X
iptables -F -t nat
iptables -t nat -X
#setup filter table default ruler
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD ACCEPT
#start NAT
iptables -t nat -A POSTROUTING -s 192.168.1.0/24 -o eth0 -j SNAT --to-source 192.168.10.165
7.客户端windows tcp/ip中设置ip为nat服务器的ip段为192.168.1.2 netmask 255.255.255.0
网关很重要 192.168.1.1为nat服务器的LAN的地址。dns为202.101.172.35。
本文出自 “有志者事竟成!” 博客,请务必保留此出处http://zh888.blog.51cto.com/1684752/380660
相关文章推荐
- 安装了VMWare之后,出现使用libcef.dll的浏览器卡顿变慢问题
- VMWare的Cloud Foundry实践(一):安装使用和第一个云端node.js程序
- 使用 VMware 在 Linux 5.4 上安装、升级及维护 Oracle 10gR2 RAC
- VMware Site Recovery Manager 5.1安装配置-Part4-使用
- 使用VMWARE(VMware8)安装Mac OSX 雪豹操作系统
- Linux-VMware安装使用
- 使用VMware(VMware Workstation 8)虚拟机安装Windows 8 RP 简体中文版详细图文教程
- VMware6安装使用教程
- 安装VMware,创建ubuntu linux虚拟机,使用Secure连接虚拟机
- VMWare 安装使用技巧
- 在VMWARE中使用ISO安装WINDOWS2000系统
- 虚拟机VMware Workstation安装与使用的一点总结,VMwarews6.0.2完美中文绿色精简版下载
- Windows7下使用VMWare12 安装CenterOS6.5虚拟机
- VMware_vSphere VMware vSphere5安装(使用SQL2008R2Enterprise) 推荐
- vmware 安装及使用虚拟机注意事项
- VMware Remote Console plug-in无法安装以及使用IE无法正常显示Vmware Server 2.0.0的解决办法
- 虚拟计算机 VMWare安装使用指南
- Hadoop自学系列集(一) ---- 使用VMware安装CentOS
- Linux必备 -- 如何在Mac OS 使用VMware 安装Linux
- 使用VMware安装CentOS7详请