[root@vms-ctos7-it-route131 ~]# iptables -t nat -L -n
Chain PREROUTING (policy ACCEPT)
target    prot opt source              destination
DNAT      tcp  --  0.0.0.0/0            192.168.183.131      tcp dpt:80 to:10.0.0.100:80 Chain INPUT (policy ACCEPT)
target    prot opt source              destination
Chain OUTPUT (policy ACCEPT)
target    prot opt source              destination
Chain POSTROUTING (policy ACCEPT)
target    prot opt source              destination
MASQUERADE  all  --  10.0.0.0/24          0.0.0.0/0
[root@vms-ctos7-it-route131 ~]#
[root@vms-ctos7-it-route131 ~]#  cat /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="dhcp"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
NAME="ens33"
UUID="8ff57dc6-0440-456a-b52f-744e2f0f808d"
DEVICE="ens33"
ONBOOT="yes"
[root@vms-ctos7-it-route131 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens37 TYPE="Ethernet"
BOOTPROTO="static"
DEFROUTE="no"
NAME="ens37"
DEVICE="ens37"
ONBOOT="yes"
IPADDR=10.0.0.1
NETMASK=255.255.255.0
# 模拟真实机器1
[root@vms-ctos7-it-real1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE="Ethernet"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"
IPV6_AUTOCONF="yes"
IPV6_DEFROUTE="yes"
IPV6_FAILURE_FATAL="no"
IPV6_ADDR_GEN_MODE="stable-privacy"
route add命令实例
NAME="ens33"
UUID="8ff57dc6-0440-456a-b52f-744e2f0f808d"
DEVICE="ens33"
ONBOOT="yes"
IPADDR=10.0.0.100
NETMASK=255.255.255.0
DNS1=8.8.8.8
[root@vms-ctos7-it-real1 ~]# ip route
default via 10.0.0.1 dev ens33
10.0.0.0/24 dev ens33 proto kernel scope link src 10.0.0.100 metric 100 [root@vms-ctos7-it-real1 ~]#
# 模拟真实机器2
[root@vms-ctos7-it-real2 ~]# cat /etc/sysconfig/network-scripts/ifcfg-ens33 TYPE="Ethernet"
PROXY_METHOD="none"
BROWSER_ONLY="no"
BOOTPROTO="static"
DEFROUTE="yes"
IPV4_FAILURE_FATAL="no"
IPV6INIT="yes"

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。