Chinaunix首页 | 论坛 | 博客
  • 博客访问: 9152821
  • 博文数量: 1727
  • 博客积分: 12961
  • 博客等级: 上将
  • 技术积分: 19860
  • 用 户 组: 普通用户
  • 注册时间: 2009-01-09 11:25
个人简介

偷得浮生半桶水(半日闲), 好记性不如抄下来(烂笔头). 信息爆炸的时代, 学习是一项持续的工作.

文章分类

全部博文(1727)

文章存档

2024年(3)

2023年(26)

2022年(112)

2021年(217)

2020年(157)

2019年(192)

2018年(81)

2017年(78)

2016年(70)

2015年(52)

2014年(40)

2013年(51)

2012年(85)

2011年(45)

2010年(231)

2009年(287)

分类: LINUX

2012-02-06 09:57:34

# sudo vi /etc/network/interfaces 增加虛擬網卡設定
auto eth0
iface eth0 inet static
address 192.168.1.253
netmask 255.255.255.0
gateway 192.168.1.254

====以下為虛擬網卡設定====
auto eth0:0
iface eth0:0 inet static
address 192.168.2.253
netmask 255.255.255.0
network 192.168.2.0
broadcast 192.168.2.255
====以上為虛擬網卡設定====

# sudo /etc/init.d/networking restart 重新啟動網路服務
* Reconfiguring network interfaces...                                                   
SIOCSIFFLAGS: Cannot assign requested address                  [ OK ]


# route  確認是否有新增虛擬網卡的Route產生
Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
192.168.2.0     *               255.255.255.0   U     0      0        0 eth0
192.168.1.0     *               255.255.255.0   U     0      0        0 eth0
default         my.router       0.0.0.0         UG    100    0        0 eth0

# ping 192.168.1.100  測試192.168.1.X 是否連線

PING 192.168.1.100 (192.168.1.100) 56(84) bytes of data.
64 bytes from 192.168.1.100: icmp_seq=1 ttl=128 time=0.112 ms
64 bytes from 192.168.1.100: icmp_seq=2 ttl=128 time=0.116 ms
--- 192.168.1.100 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 999ms
rtt min/avg/max/mdev = 0.112/0.114/0.116/0.002 ms

#ping 192.168.2.100 測試192.168.2.X 是否連線

PING 192.168.2.100 (192.168.2.100) 56(84) bytes of data.
64 bytes from 192.168.2.100: icmp_seq=1 ttl=128 time=5.22 ms
64 bytes from 192.168.2.100: icmp_seq=2 ttl=128 time=0.122 ms
--- 192.168.2.100 ping statistics ---
2 packets transmitted, 2 received, 0% packet loss, time 1006ms
rtt min/avg/max/mdev = 0.122/2.671/5.221/2.550 ms

以上就是在Ubuntu上面新增一張虛擬網卡的方式
阅读(2967) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~