Linux上实现mpls的环境配置

来源:互联网 发布:北京海量数据怎么样 编辑:程序博客网 时间:2024/06/12 14:24

这个参考了别的博客,加上自己搭环境时遇到问题或不懂的地方的记录,若有问题,望及时联系,希望能有帮助~~~~

参考博客:http://blog.csdn.net/SimonCZW/article/details/52538671?locationNum=13&fps=1

ubuntu系统上:

1 更新内核(因为只有在4.5版本以上的linux内核才能支持mpls模块)

1 获取内核:
http://kernel.ubuntu.com/~kernel-ppa/mainline/     里面有内核版本,可自行下载自己需要的版本

或者通过:wget

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.6-yakkety/linux-headers-4.6.0-040600_4.6.0-040600.201606100558_all.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.6-yakkety/linux-headers-4.6.0-040600-generic_4.6.0-040600.201606100558_amd64.deb

wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.6-yakkety/linux-image-4.6.0-040600-generic_4.6.0-040600.201606100558_amd64.deb

2 安装:

在下载好的内核放到一个文件夹里,在这个文件夹里执行下面操作

dpkg -i *.deb

3  更新 grub 和 reboot 

      update-grub 

  reboot

注:1 查看当前Ubuntu系统使用的内核版本:uname -a

       2 查看系统内存在的内核版本列表:sudo dpkg --get-selections |grep linux

       3 删除多余内核:sudo apt purge linux-headers-4.4.0-27 linux-image-4.4.0-27-generic(linux-headers-4.4.0-27 linux-image-4.4.0-27-generic这就就是你不想要的内核版本,把带4.4.0的都删去,目的是节省空间)

2 安装quagga-Idpd(注意,是不能默认安装的,因为默认的quagga

  1. git clone 
    git clone https://github.com/rwestphal/quagga-ldpd.git
  2. apt-get 
    apt-get install autoconf automake texinfo libtool gawk  libreadline-dev
  3. create Makefile 
    cd quagga-ldpd 
    ./bootstrap.sh #autoreconf -i
  4. ./configure 
    ./configure --enable-tcp-zebra --enable-mpls --enable-ldpd --sysconfdir=/etc/quagga --localstatedir=/var/run
  5. make & make install 
    make 
    make install
  6. ldconfig 
    ldconfig /usr/local/lib

3 调整MPLS内核参数,启动MPLS 

modprobe mpls_router 

modprobe mpls_gso 

modprobe mpls_iptunnel 

sysctl -w net.mpls.conf.eth0.input=1 

sysctl -w net.mpls.conf.lo.input=1 

sysctl -w net.mpls.platform_labels=1048575

注:路由器是不止一个接口的,所以要设置网络适配器,多增加几个接口,sysctl -w net.mpls.conf.eth0.input=1 这条语句设置,将eth0换成你的接口的名字,不然MPLS路由器不会接受路由

4 启动quagga:(这部分还没看懂,待续~~~)


centos 7上

1 升级内核:

         1 查看已有内核版本:

uname -sr

2 导入公钥:

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

3 安装并启用ELRepo

rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

4 列出可用内核相关包

yum --disablerepo="*" --enablerepo="elrepo-kernel" list available

5 安装最新的主线稳定的内核包

yum --enablerepo=elrepo-kernel install kernel-ml  (注:ml:mainline stable,还有lt的)

6 重启

reboot

7 查看是否升级内核成功

uname -sr

8 更改grub,可以自己查找设置,目前没用,先不写)

  2 安装quagga-ldpd:(整体和

原创粉丝点击