2020-08-28 kvm的网络配置和nat转发

2021-02-22  本文已影响0人  五大RobertWu伍洋
[root@226 ~]# history|grep nat
   31  cat <<EOF > nat223.xml
   33    <name>nat223</name>
   34    <forward mode='nat' dev='br0'/>
   44  vi nat223.xml
   46  vi nat223.xml
   47  virsh define nat223.xml
   48  virsh net-define nat223.xml
   49  virsh net-start nat223
   51  virsh net-autostart nat223
   54  iptables -t nat -L -n -v --line-number | grep 223
   73  virt-install --virt-type kvm --name centos7 --ram 20480 --disk centos.qcow2 --network network=nat223 --os-type=linux --os-variant=rhel7.0 --location=CentOS-7-aarch64-Minimal-2003.iso --graphics none --console pty,target_type=serial    --extra-args 'console=ttyS0,115200n8 serial'
  112  virt-install --name=c1 --vcpus=12 --ram=20480 --disk path=/data/kvm/images/c1.img,format=qcow2,size=100,bus=virtio --cdrom  /data/CentOS-7-aarch64-Minimal-2003.iso --network network=nat223 --force --autostart
  131  virt-install --name=c1 --vcpus=12 --ram=20480 --disk path=/data/kvm/images/c1.img,format=qcow2,size=100,bus=virtio --cdrom  /data/CentOS-7-aarch64-Minimal-2003.iso --network network=nat223 --force --autostart
  147  iptables -t nat -L -n -v --line-number
  150  cat nat223.xml
  151  iptables -t nat -I PREROUTING -p tcp -d 172.169.43.226 --dport 80 -j DNAT --to-destination 192.168.223.15:80
  152  iptables -t nat -L -n -v --line-number
  156  iptables -t nat -I PREROUTING -p tcp -d 172.169.43.226 --dport 8888 -j DNAT --to-destination 192.168.223.15:8888
  157  iptables -t nat -I PREROUTING -p tcp -d 172.169.43.226 --dport 443 -j DNAT --to-destination 192.168.223.15:443
  158  iptables -t nat -I PREROUTING -p tcp -d 172.169.43.226 --dport 8887 -j DNAT --to-destination 192.168.223.15:8887
  159  iptables -t nat -I PREROUTING -p tcp -d 172.169.43.226 --dport 8443 -j DNAT --to-destination 192.168.223.15:8443
  160  iptables -t nat -I PREROUTING -p tcp -d 172.169.43.226 --dport 8283 -j DNAT --to-destination 192.168.223.15:8283
  199  cat nat223.xml
  242  more nat223.xml
  280  nohup virt-install --name=robFresh --vcpus=12 --ram=32480 --disk path=/data/kvm/images/robFresh.img,format=qcow2,size=100,bus=virtio --cdrom  /data/CentOS-7-aarch64-Minimal-2003.iso --network network=nat223 --force --autostart &> robFresh.log &
  293  cat nat223.xml
  365  history|grep nat

上一篇下一篇

猜你喜欢

热点阅读