Doesn't allow forwarding a range of ports through the UI

I recently had to forward a range of ports to a VirtualBox instance. The VirtualBox GUI doesn’t provide a method for forwarding a range of ports. The VirtualBox Manual describes a way for adding the rule via the command-line:

VBoxManage modifyvm "VM name" --natpf1 "guestssh,tcp,,2222,,22"

This forwards any traffic arriving on port 2222 to port 22 on the virtual instance. We can use this to create a short bash loop. In the example below, we’re forwarding ports 2300-2400 to ports 2300-2400 on the virtual instance (both TCP and UDP):

for i in {2300..2400}; do
VBoxManage modifyvm "windows" --natpf1 "tcp-port$i,tcp,,$i,,$i";
VBoxManage modifyvm "windows" --natpf1 "udp-port$i,udp,,$i,,$i";
done

You can verify this by going back into the VirtualBox port forwarding page and seeing the newly configured ports. It’s just as easy to delete them:

for i in {2300..2400}; do
VBoxManage modifyvm "windows" --natpf1 delete "tcp-port$i"; 
VBoxManage modifyvm "windows" --natpf1 delete "udp-port$i"; 
done

This should suffice until the capability is added to the VirtualBox UI.

 

Forwarding a Range of Ports in VirtualBox的更多相关文章

  1. 服务器上安装FileZilla Server连接时报You appear to be behind a NAT router. Please configure the passive mode settings and forward a range of ports in your router.

    官方资源下载链接:客户端,或者直接点击下载“FileZilla_3.24.0_win64-setup.exe”:服务端,或者直接点击下载“FileZilla_Server-0_9_60_2.exe”: ...

  2. 路由器port触发与转发---Port Forwarding & Port Triggering

    What is Port Triggering? If you have not read my explanation of port forwarding do so now. You can f ...

  3. squid对http range的处理以及range_offset_limit

    range_offset_limit A range request comes from a client that wants only some subset of an HTTP respon ...

  4. vyatta的fork开源版本

    https://www.reddit.com/r/networking/comments/3dvwfy/who_here_is_using_vyos/ Vyatta came in two flavo ...

  5. dhcpsrv:windows系统的优秀开源免费dhcp serve软件

    概述: 官方网站 :http://www.dhcpserver.de/ 写博客时的可免费下载版本  2.52, 或者在cnblogs 本地下载 --========================== ...

  6. vyatta的fork开源版本vyos

    vyatta的fork开源版本vyos 来源: https://www.reddit.com/r/networking/comments/3dvwfy/who_here_is_using_vyos/ ...

  7. 【转】刚发现一个linux在线文档库。很好很强大。

    原文网址:http://blog.csdn.net/longxibendi/article/details/6048231 1.网址: http://www.mjmwired.net 2.比如查看这个 ...

  8. Ettercap 帮助文档

    Ettercap(8)帮助 (翻译来自百度翻译,原文附于文后,个人润色) 1.概述 Ettercap-多用途嗅探器/内容过滤器,用于中间人攻击 重要提示 自Ettercap Ng(以前为0.7.0)以 ...

  9. useful commands for docker beginner

    You may want to add my wechat public account or add my technical blog's RSS feed This list is meant ...

随机推荐

  1. 《深入Java虚拟机学习笔记》- 第19章 方法的调用与返回

    <深入Java虚拟机学习笔记>- 第19章 方法的调用与返回

  2. 转载crontab例行工作调度

    转自:http://blog.sina.com.cn/s/blog_95ee143401017y70.html crontab [-e [UserName]|-l [UserName]|-r [Use ...

  3. Jmeter性能测试之如何写Java请求测试用例类

    一. 引言: 最近工作中的一个项目要求做性能测试,该项目由提供服务的几个应用组成,选用的框架是阿里巴巴公司开源的服务框架Dubbo.关于Dubbo的介绍,网上也有很多资料,本人只是做了粗略的了解,没有 ...

  4. IntelliJ远程调试教程

    概述 对于分布式系统的调试不知道大家有什么好的方法.对于我来说,在知道远程调试这个方法之前就是在代码中打各种log,然后重新部署,上线,调试,这样比较费时.今天咱们来了解了解Java远程调试这个牛逼的 ...

  5. vs2015中升级Nuget后,找不到Umbraco安装包问题

    打开VS2015, Tools=>Extensions and Updates=> Updates => Visual Studio Gallery   在这里check一下是否有N ...

  6. 转载 SharePoint开发部署WSP解决方案包

    转载原出处: http://642197992.blog.51cto.com/319331/1582731 注:本文所讲内容以SharePoint2013版本为例,开发工具以VS2013为基础.历史版 ...

  7. jquery完成带复选框的表格行高亮显示

    jquery完成带复选框的表格行高亮显示 通过jquery技术来操作表格是件简单的事,通过jquery的语法,可以很轻松的完成表格的隔行换色,悬浮高亮,在实际的应用中可能会出现表格中带复选框的,删除时 ...

  8. SMP和MAPP的区别

    SMP(Symmetrical Multi-Processing),对称多处理系统,是指在一个计算机上汇集了一组处理器(多CPU),各CPU之间共享内存子系统以及总线结构.它是相对非对称多处理技术而言 ...

  9. NSArrary和NSString间的转换

    将string字符串转换为array数组 NSArray  *array = [Str componentsSeparatedByString:@","]; // 注意:NSArr ...

  10. [转]Java 动态代理机制分析及扩展

    引言 Java 动态代理机制的出现,使得 Java 开发人员不用手工编写代理类,只要简单地指定一组接口及委托类对象,便能动态地获得代理类.代理类会负责将所有的方法调用分派到委托对象上反射执行,在分派执 ...