设为首页 收藏本站
查看: 3012|回复: 6

[经验分享] Vyatta Virtual Router on Hyper-V

[复制链接]

尚未签到

发表于 2012-7-4 15:28:22 | 显示全部楼层 |阅读模式
I’m currently building a new demo/test environment on my Windows Server 2008 Hyper-V server. And I wanted to have a Virtual Router running on Hyper-V which should handle the routing between the virtual networks on Hyper-V.
First some background info on my network at home.
57425811b94e1a9c6b3042d78f8155ee.png
So I looked for a software router which could be installed as a guest on my Hyper-V host. I started with BrazilFW, but I had trouble to get the Gateway and DNS running (failed) although a colleague was able to get BrazilFW running on Hyper-V by upgrading the SYSLINUX (bootloader for Linux). Then I tried Freesco and m0n0wall, but both would not start on Hyper-V. So I finally found Vyatta via SourceForge.
Vyatta is a Linux-based, open network operating system that integrates advanced enterprise-class routing, security, bandwidth management and more. Vyatta runs on standard x86 hardware, VMWare & Xen and offers config via Linux-shell, CLI and web GUI.
It runs on VMWare & Xen so why would not it run on Hyper-V? And I was correct it runs great on Hyper-V ;-) These are steps I’ve taken to get it running on Hyper-V.
  • Downloading ISO image from Vyatta’s website
    Vyatta Community Edition 4.0 (VC4)
  • Create a new Virtual Machine in Hyper-V Manager
    Attach the ISO downloaded in step 1 to the new Vyatta Virtual Machine so it can boot from the ISO.
  • Configure the Vyatta Virtual Machine
    Add the Network Adapters for the Internet, and the needed subnets to Vyatta Virtual Machine.
    Remark: Use Legacy Network Adapters!
    fd2c6d8534ddd8861c6aebf4207fe95e.png

    I added a 1 GB harddisk and gave it 128 MB RAM.
  • Installing Vyatta
    You can boot from the ISO you downloaded in step 1.  because it’s also a “Live CD”
    You’ll first need to login to Vyatta once it’s booted up. The default logins are (user: root pass: Vyatta) To install to the drive you will issue the command:
    install-system
    During the install you will be asked how much diskspace to allot to the different partitions. I went with the default. Once that’s complete, pop the CD out, and reboot to your installed Vyatta. Now we can start configuring the system.
  • Configuring Ethernet Interfaces
    Log on the system.
    Configure the first NIC (eth0) which is going to be used for Internet access.

    eht0:
    vyatta@vyatta> configure
    [edit]
    vyatta@vyatta# set interfaces ethernet eth0 address 192.168.1.254/24
    [edit]
    vyatta@vyatta# commit
    [edit]
    vyatta@vyatta# exit
    exit
    vyatta@vyatta>

    eth1:
    vyatta@vyatta> configure
    [edit]
    vyatta@vyatta# set interfaces ethernet eth1 address 192.168.2.254/24
    [edit]
    vyatta@vyatta# commit
    [edit]
    vyatta@vyatta# exit
    exit
    vyatta@vyatta>

    eth2:
    vyatta@vyatta> configure
    [edit]
    vyatta@vyatta# set interfaces ethernet eth2 address 192.168.3.254/24
    [edit]
    vyatta@vyatta# commit
    [edit]
    vyatta@vyatta# exit
    exit
    vyatta@vyatta>
    Check interfaces configuration:
    vyatta@vyatta:~$ configure
    [edit]
    vyatta@vyatta# show interfaces ethernet
    eth0 {
         address 192.168.1.254/24
         description Internet
         hw-id 00:15:5d:00:01:22
    }
    eth1 {
         address 192.168.2.254/24
         description "subnet1:MOM 2005"
          hw-id 00:15:5d:00:01:23
    }
    eth2 {
         address 192.168.3.254/24
         description "subnet2:OPSMGR 2007"
    }
  • Save Configuration
    vyatta@vyatta# save
    Saving configuration to
    '/opt/vyatta/etc/config/config.boot'...
    Done
    [edit]
  • Configuring Access to a DNS Server
    vyatta@vyatta# set system name-server 192.168.1.1
    [edit]
    vyatta@vyatta# commit
    [edit]
    vyatta@vyatta#
  • Specifying the Default Gateway
    vyatta@vyatta# set system gateway-address 192.168.1.1
    [edit]
    vyatta@vyatta# commit
    [edit]
    vyatta@vyatta#
  • Configuring the Firewall
    We want to block the traffic from subnet1 to subnet2 and visa-versa.
    Firewall block-subnet1 rules:
    vyatta@vyatta# set firewall name block-subnet1
    [edit]
    vyatta@vyatta# set firewall name block-subnet1 rule 1
    [edit]
    vyatta@vyatta# set firewall name block-subnet1 rule 1 source address 192.168.2.0/24
    [edit]
    vyatta@vyatta# set firewall name block-subnet1 rule 1 action drop
    [edit]
    vyatta@vyatta# set firewall name block-subnet1 rule 2
    [edit]
    vyatta@vyatta# set firewall name block-subnet1 rule 2 action accept
    vyatta@vyatta# commit
    [edit]
    vyatta@vyatta#
    Do the same for subnet2.
    vyatta@vyatta# set firewall name block-subnet2
    [edit]
    vyatta@vyatta# set firewall name block-subnet2 rule 1
    [edit]
    vyatta@vyatta# set firewall name block-subnet2 rule 1 source address 192.168.3.0/24
    [edit]
    vyatta@vyatta# set firewall name block-subnet2 rule 1 action drop
    [edit]
    vyatta@vyatta# set firewall name block-subnet2 rule 2
    [edit]
    vyatta@vyatta# set firewall name block-subnet2 rule 2 action accept
    vyatta@vyatta# commit
    [edit]
    vyatta@vyatta#
  • Apply the rule set to an interfaces
    vyatta@vyatta# set interfaces ethernet eth1 firewall out name block-subnet2
    [edit]
    vyatta@vyatta# set interfaces ethernet eth2 firewall out name block-subnet1
    [edit]
    vyatta@vyatta# commit
    [edit]
    vyatta@vyatta#

Final configuration:
vyatta@vyatta:~$ show configuration
firewall {
    name block-subnet1 {
        rule 1 {
            action drop
            source {
                address 192.168.2.0/24
            }
        }
        rule 2 {
            action accept
        }
    }
    name block-subnet2 {
        rule 1 {
            action drop
            source {
                address 192.168.3.0/24
            }
        }
        rule 2 {
            action accept
        }
    }
    name block-subnet3 {
        rule 1 {
            action drop
            source {
                address 192.168.2.0/24
            }
        }
        rule 2 {
            action accept
        }
        rule 3 {
            action drop
            source {
                address 192.168.3.0/24
            }
        }
    }
}
interfaces {
    ethernet eth0 {
        address 192.168.1.254/24
        description Internet
        hw-id 00:15:5d:00:01:22
    }
    ethernet eth1 {
        address 192.168.2.254/24
        description "subnet1:MOM 2005"
        firewall {
            out {
                name block-subnet2
            }
        }
        hw-id 00:15:5d:00:01:23
    }
    ethernet eth2 {
        address 192.168.3.254/24
        description "subnet2:OPSMGR 2007"
        firewall {
            out {
                name block-subnet1
            }
        }
        hw-id 00:15:5d:00:01:24
    }
    loopback lo {
    }
}
service {
    nat {
        rule 1 {
            outbound-interface eth0
            source {
                address 192.168.2.0/24
            }
            type masquerade
        }
        rule 2 {
            outbound-interface eth0
            source {
                address 192.168.3.0/24
            }
            type masquerade
        }
    }
    ssh {
    }
}
system {
    gateway-address 192.168.1.1
    login {
        user root {
            authentication {
                encrypted-password ****************
            }
        }
        user vyatta {
            authentication {
                encrypted-password ****************
            }
        }
    }
    name-server 192.168.1.1
    ntp-server 69.59.150.135
    package {
        repository community {
            components main
            distribution stable
            url http://packages.vyatta.com/vyatta
        }
    }
}
vyatta@vyatta:~$
Don’t forget to save your configuration!
Now you are done! Check out the documentation for Vyatta before starting. I used the QuickStart and the Command Reference.

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-470-1-1.html 上篇帖子: 没有了 下篇帖子: vyatta软件路由器配置指南 although background 2008 currently software

尚未签到

发表于 2012-7-7 14:35:01 | 显示全部楼层
这个帖子不错,大家快来顶起来!

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

尚未签到

发表于 2012-7-7 14:35:10 | 显示全部楼层
{:6_407:}

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

尚未签到

发表于 2013-5-15 17:31:10 | 显示全部楼层
不在课堂上沉睡,就在酒桌上埋醉。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

尚未签到

发表于 2013-5-16 16:58:45 | 显示全部楼层
我的id是假冒的,大家不要相信我是骗子。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

尚未签到

发表于 2013-5-17 11:25:08 | 显示全部楼层
流氓不可怕,就怕流氓有文化。

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

尚未签到

发表于 2013-5-18 00:37:16 | 显示全部楼层
不知该说些什么。。。。。。就是谢谢

运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表