Azure上每个VM多个IP地址
Azure的每个VM都有多种IP地址,包括DIP、VIP和PIP。具体如下:
DIP地址是在VM里能够看到的IP地址,即私网地址;PIP地址是这个VM关联的公网IP地址,即公网地址;VIP地址是负载均衡的地址。
目前Azure的VM已经支持每个网卡关联多个ipconfig,即可以支持VM的每个网卡关联多个私网和公网地址:DIP和PIP。
如下图:
具体配置如下:
1. VM种NIC的ipconfig
2. 添加ipconfig
点击添加后:
按相同的方法再添加第三个ipconfig,配置完后的配置结果:
3. VM内的配置(CentOS7)
登录到VM中,做如下修改:
[root@hwvntp01 init.d]# cd /etc/sysconfig/network-scripts/
[root@hwvntp01 network-scripts]# vim ifcfg-eth0:
DEVICE=eth0:
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.3.1.6
NETMASK=255.255.255.0
[root@hwvntp01 network-scripts]# vim ifcfg-eth0:
DEVICE=eth0:
ONBOOT=yes
BOOTPROTO=static
IPADDR=10.3.1.7
NETMASK=255.255.255.0
然后重启Network的服务:
[root@hwvntp01 network-scripts]# cd /etc/init.d
[root@hwvntp01 init.d]# ./network restart
4. 检验
[root@hwvntp01 html]# ifconfig
eth0: flags=<UP,BROADCAST,RUNNING,MULTICAST> mtu
inet 10.3.1.5 netmask 255.255.255.0 broadcast 10.3.1.255
inet6 fe80:::faff:fe00:40f2 prefixlen scopeid 0x20<link>
ether ::fa:::f2 txqueuelen (Ethernet)
RX packets bytes (125.5 MiB)
RX errors dropped overruns frame
TX packets bytes (46.3 MiB)
TX errors dropped overruns carrier collisions
eth0:: flags=<UP,BROADCAST,RUNNING,MULTICAST> mtu
inet 10.3.1.6 netmask 255.255.255.0 broadcast 10.3.1.255
ether ::fa:::f2 txqueuelen (Ethernet)
eth0:: flags=<UP,BROADCAST,RUNNING,MULTICAST> mtu
inet 10.3.1.7 netmask 255.255.255.0 broadcast 10.3.1.255
ether ::fa:::f2 txqueuelen (Ethernet)
lo: flags=<UP,LOOPBACK,RUNNING> mtu
inet 127.0.0.1 netmask 255.0.0.0
inet6 :: prefixlen scopeid 0x10<host>
loop txqueuelen (Local Loopback)
RX packets bytes (1.0 KiB)
RX errors dropped overruns frame
TX packets bytes (1.0 KiB)
TX errors dropped overruns carrier collisions
[root@hwvntp01 html]# ping www.sina.com.cn
PING ara.sina.com.cn (121.14.1.190) () bytes of data.
bytes from 121.14.1.190 (121.14.1.190): icmp_seq= ttl= time=45.7 ms
bytes from 121.14.1.190 (121.14.1.190): icmp_seq= ttl= time=45.7 ms
^C
--- ara.sina.com.cn ping statistics ---
packets transmitted, received, % packet loss, time 1001ms
rtt min/avg/max/mdev = 45.710/45.716/45.723/0.213 ms
[root@hwvntp01 html]# ping -I 10.3.1.6 www.sina.com.cn
PING ara.sina.com.cn (121.14.1.190) from 10.3.1.6 : () bytes of data.
bytes from 121.14.1.190 (121.14.1.190): icmp_seq= ttl= time=48.4 ms
bytes from 121.14.1.190 (121.14.1.190): icmp_seq= ttl= time=48.5 ms
^C
--- ara.sina.com.cn ping statistics ---
packets transmitted, received, % packet loss, time 999ms
rtt min/avg/max/mdev = 48.406/48.470/48.535/0.229 ms
[root@hwvntp01 html]# ping -I 10.3.1.7 www.sina.com.cn
PING ara.sina.com.cn (121.14.1.190) from 10.3.1.7 : () bytes of data.
bytes from 121.14.1.190 (121.14.1.190): icmp_seq= ttl= time=46.3 ms
bytes from 121.14.1.190 (121.14.1.190): icmp_seq= ttl= time=46.4 ms
bytes from 121.14.1.190 (121.14.1.190): icmp_seq= ttl= time=46.1 ms
bytes from 121.14.1.190 (121.14.1.190): icmp_seq= ttl= time=46.2 ms
^C
--- ara.sina.com.cn ping statistics ---
packets transmitted, received, % packet loss, time 5958ms
rtt min/avg/max/mdev = 46.190/46.298/46.423/0.277 ms
5. 通过服务检验
在VM中安装httpd:
yum install -y httpd
systemctl start httpd
systemctl status httpd
● httpd.service - The Apache HTTP Server
Loaded: loaded (/usr/lib/systemd/system/httpd.service; disabled; vendor preset: disabled)
Active: active (running) since Fri -- :: UTC; 6s ago
Docs: man:httpd()
man:apachectl()
Main PID: (httpd)
从外部检测:
三个地址都可以访问。
Azure上每个VM多个IP地址的更多相关文章
- Linux VM 设置静态ip地址上网
因为是路由器共享上网,VM每次都是通过DHCP方式自动获取ip地址,连接Linux VM时ip地址经常变,很麻烦.现在把VM设置静态ip的方法总结一下,以免以后忘了. 1. VM上网方式设置为桥接. ...
- Windows Azure 上 Linux VM 中的交换空间 – 第 2 部分
本文章由 Azure CAT 团队的 Piyush Ranjan (MSFT) 撰写. 在前一篇文章 Windows Azure 上Linux VM 中的交换空间第 1 部分中,我介绍了在默认情况下, ...
- Android 手机上获取手机当前上网IP地址
[转] 原文 Android 手机上获取手机当前上网IP地址 (手机网关给手机号分配的IP) 每个手机上网通过移动网关的时候,网关都会给该手 ...
- Azure ARM (12) ARM模式下,在负载均衡器上设置多个公网IP地址
<Windows Azure Platform 系列文章目录> 最近在帮助一个客户设置WAF (Web Application Firewall),WAF厂商要求在负载均衡器上,设置多个公 ...
- 在Windows Azure上配置VM主备切换(1)——Linux篇
对任何一个上线系统来说,高可用设计是不可或缺的一个环节,这样才可以确保应用可以持续.稳定的运行,而不是频繁的掉线.停机.高可用设计的核心思路很简单,就是消除一切单点故障,将单点链路或者节点升级为多点. ...
- pycharm上运行django服务器端、ip地址访问
安装Django 下载Django包,解压缩. CMD 进入解压路径下. 执行:python setup.py install 增加环境变量: C:\Python27\Scripts 测试djang ...
- Windows Azure 设置虚拟机静态外网IP地址
官方说法叫做“虚拟公共IP地址保留”,为容易理解,我们称之为静态外网IP地址. 如果在国内使用国际版Windows Azure服务时强烈推荐为虚拟机设置IP地址保留. 由于Windows Azure ...
- Azure上Linux VM防DDOS攻击:使用Apache mod_evasive
部署在云端的虚拟机和web服务,很容易受到DoS护着DDoS的服务攻击,让一些新上线的业务苦不堪言,当然各个云服务提供商也有不同层面DDOS的防护,然而由于防护粒度,攻击复杂度的关系,未必可以满足你的 ...
- 在Azure上的VM镜像库中找到想要的镜像
Azure上的虚机镜像库中, 有很多的镜像,其中当然也包括了用户自定义上传的镜像. 在Powershell中如果想使用这些镜像的话, 则需要知道其名称 下面这条命令,可以获得所有的镜像信息 $imag ...
随机推荐
- java配置文件转义问题
场景: 配置文件config.properties 配置项cfg.regexp=\d+\t 加载配置文件代码 InputStream ins = PropManager ...
- php数组函数-array_keys()
array_keys()函数返回包含数组中所有键名的一个新数组 如果提供了第二个参数,则返回键值为该值得键名 如果strict参数指定为true,则php会使用全等(===)来严格检查键值的 数据类型 ...
- Whitewidow:SQL 漏洞自动扫描工具
Whitewidow 是一个开源的 SQL 漏洞自动扫描器,可用通过文件列表运行,或者从 Google 爬取并发现有潜在漏洞的网站. 这个工具支持自动格式化文件.随机用户代理.IP 地址.服务器信息. ...
- 搭建本地yum源服务器
搭建本地yum源服务器 好久没写博客了,最近比较动荡,临毕业时跳了个槽,感觉之前做的金融方向的运维不是很适合我,对各方面的限制还是太多.金融的IT对于安全似乎要求很高,云盘,U盘都不能用,还要经常 ...
- iptables基础知识详解
iptables防火墙可以用于创建过滤(filter)与NAT规则.所有Linux发行版都能使用iptables,因此理解如何配置 iptables将会帮助你更有效地管理Linux防火墙.如果你是第一 ...
- JAVA使用Freemarker生成静态文件中文乱码
1.指定Configuration编码 Configuration freemarkerCfg = new Configuration(); freemarkerCfg.setEncoding(Loc ...
- php记录代码执行时间
$t1 = microtime(true); // ... 执行代码 ... $t2 = microtime(true); echo '耗时'.round($t2-$t1,3).'秒'; 简单说一下. ...
- codevs 2800 送外卖 TSP问题
2800 送外卖 时间限制: 2 s 空间限制: 256000 KB 题目等级 : 钻石 Diamond 题目描述 Description 有一个送外卖的,他手上有n份订单,他要把n份 ...
- boot小知识
lg 大, md 中等, sm 小, xs 极小. 可以单独用,也可以混合用,不同的屏幕用不同的比例. push ,pull 推拉.这个不实用. row里面可以嵌套实用row. 挤不下的时候,就会自动 ...
- Apache虚拟主机配置模板
/////////////////////////////////写在前头////////////////////////////////////////1.Apache HTTP 服务器2.4文档: ...