Ubuntu单网卡设置安装双interface和Stun server的方法

运维 系统运维
Ubuntu单网卡下如何设置双interface和Stun server的安装呢?下文给出了详细的描述,具体内容如下所述。

Ubuntu单网卡下如何设置双interfaceStun server的安装呢?下文给出了详细的描述,具体内容如下所述。

因为stun server需要同时监听两个entry(即两对IP和PORT)进行对NAT的检测,所以需要server需要两个interface. 首先在Ubuntu上设置两个虚拟的interface,因为只有一个物理的interface,所以只能在这一个上进行虚拟。编辑网络interface文件/etc/network/interfaces, 如下: ====================================================

  1.  # more interfaces  
  2. auto lo  
  3. iface lo inet loopback  
  4. auto eth0:0                                            /*启用虚拟iface0:0*/  
  5. iface eth0:0 inet static                              /*设置此iface为静态IP*/  
  6. address 172.25.27.218  
  7. netmask 255.255.255.0  
  8. gateway 172.25.27.254 auto eth0:1                                         
  9. iface eth:1 inet dhcp                               /*设置此iface为动态获取IP* 

======================================================

然后重启网络配置

 

  1. sudo /etc/init.d/networking restart. 

 

下载stun server的软件stund_0.96_Aug13.gz,然后解压。进入stun安装目录,然后make就ok了。 ====================================================== :~

  1. # cd stund  
  2. all   
  3. # ./server -h  
  4. STUN server version 0.96  
  5. Usage:  
  6. ./server [-v] [-h] [-h IP_Address] [-a IP_Address] [-p port] [-o port] [-m mediaport] If the IP addresses of your NIC are 10.0.1.150 and 10.0.1.151, run this program with  
  7.     ./server -v -h 10.0.1.150 -a 10.0.1.151  
  8. STUN servers need two IP addresses and two ports, these can be specified with:  
  9. -h sets the primary IP  
  10. -a sets the secondary IP  
  11. -p sets the primary port and defaults to 3478  
  12. -o sets the secondary port and defaults to 3479  
  13. -b makes the program run in the backgroud  
  14. -m sets up a STERN server starting at port m  
  15. -v runs in verbose mode # 

===========================================================

启动就简单了,有-h提示,一目了然。

  1. -v -h 172.25.27.126 -a 172.25.27.218  

总结:

希望本文介绍的Ubuntu单网卡设置安装双interface和Stun server的方法能够对读者有所帮助,更多有关linux系统的知识还有待于读者去探索和学习。

责任编辑:韩亚珊 来源: 火魔网
相关推荐

2011-04-14 11:41:41

UbuntuIP

2010-07-27 13:07:23

NFS Server

2009-07-10 16:31:01

Ubuntu下安装JD安装Tomcat

2010-08-03 11:41:24

Ubuntu NFS

2011-09-06 14:44:05

Ubuntu

2011-08-11 11:07:16

路由器设置

2010-02-22 13:31:32

Ubuntu安装

2011-08-30 17:12:27

Ubuntuwindows7

2011-03-10 10:51:45

Ubuntu搭建LAMP

2011-09-08 10:21:16

UbuntuSNMP

2012-05-24 17:02:47

Ubuntu 12.0

2012-06-28 11:46:54

WindowsUbuntu

2010-03-03 13:56:43

Linux ubant

2011-09-01 16:59:28

UbuntuApache

2009-08-22 20:31:01

Ubuntu安装VMw

2011-09-07 13:33:51

ubuntuUbuntu Twea

2010-07-21 09:28:46

Ubuntu Linu

2010-03-05 14:09:12

Ubuntu文本安装

2011-03-15 13:39:14

iptablesstun

2010-01-05 14:11:32

Linux安装无线网卡
点赞
收藏

51CTO技术栈公众号