我查了man ifconfig,没有看到关于这个参数的介绍,是不支持么?如果ifconfig不行,别的什么命令可以么?
ps:我只需要shell下使用命令的解决方案,通过GUI的方式就不用说了。
[问题]在kubuntu下,怎样使用ifconfig为网卡指定网关和DNS?
- tigerdoo
- 帖子: 327
- 注册时间: 2006-11-17 23:02
[问题]在kubuntu下,怎样使用ifconfig为网卡指定网关和DNS?
IBM T41-P4M 1.5G/1GB/40GB HDD/DVD/14.1TFT/IPW2100 & 10-100M
OS:Xubuntu 11.10
生活就是折腾
活在成都
使用update-rc.d管理Linux服务
OS:Xubuntu 11.10
生活就是折腾
活在成都
使用update-rc.d管理Linux服务
- tigerdoo
- 帖子: 327
- 注册时间: 2006-11-17 23:02
此案无解么?
IBM T41-P4M 1.5G/1GB/40GB HDD/DVD/14.1TFT/IPW2100 & 10-100M
OS:Xubuntu 11.10
生活就是折腾
活在成都
使用update-rc.d管理Linux服务
OS:Xubuntu 11.10
生活就是折腾
活在成都
使用update-rc.d管理Linux服务
-
- 帖子: 5
- 注册时间: 2006-11-29 15:45
- qianwx
- 帖子: 730
- 注册时间: 2006-07-08 14:41
- mymike
- 帖子: 69
- 注册时间: 2007-07-15 23:56
- 联系:
-
- 帖子: 1
- 注册时间: 2008-01-16 10:22
你可以在自己的目录下建立两个文件,加入你要在两个ip地址之间要交换
这个是第一个的ip的配置信息
auto lo
iface lo inet loopback
iface eth0 inet static
pre-up iptables-restore< /etc/iptables
post-down iptables-restore < /etc/iptables
post-down iptables-save > /etc/iptables
address 222.30.20.45
netmask 255.255.254.0
gateway 222.30.20.1
auto eth1
iface eth1 inet dhcp
auto eth2
iface eth2 inet dhcp
auto ath0
iface ath0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
iface dsl-provider inet ppp
provider dsl-provider
auto eth0
第二个类似
当你要改变的时候需要
root@fishcoder-desktop:/home/fishcoder/bin# cp interfaces.school /etc/network/interfaces
root@fishcoder-desktop:/home/fishcoder/bin# /etc/init.d/networking restart
运行之就应该可以了~
这个是第一个的ip的配置信息
auto lo
iface lo inet loopback
iface eth0 inet static
pre-up iptables-restore< /etc/iptables
post-down iptables-restore < /etc/iptables
post-down iptables-save > /etc/iptables
address 222.30.20.45
netmask 255.255.254.0
gateway 222.30.20.1
auto eth1
iface eth1 inet dhcp
auto eth2
iface eth2 inet dhcp
auto ath0
iface ath0 inet dhcp
auto wlan0
iface wlan0 inet dhcp
iface dsl-provider inet ppp
provider dsl-provider
auto eth0
第二个类似
当你要改变的时候需要
root@fishcoder-desktop:/home/fishcoder/bin# cp interfaces.school /etc/network/interfaces
root@fishcoder-desktop:/home/fishcoder/bin# /etc/init.d/networking restart
运行之就应该可以了~
-
- 帖子: 445
- 注册时间: 2007-08-27 17:31
ifconfig是linux的CLI配置以太网工具
可以用来查看网络接口也可以用来配置网络
ifconfig <网络接口> <ip> [<Mask><Broadcast>]
如:ifconfig eth0 192.168.0.1 (命令启动eth0接口,并设置ip为192.168.0.1,子网为255.255.255.0
广播为192.168.0.255 )
当ip地址使用标准A.B.C类地址,子网,广播系统会自动判断,可以省略
如果有需要如:
ifconfig eth0 10.0.0.10 Mask 255.255.255.0 Broadcast 10.0.0.255
最后还需要注意,用ifconfig配置网络是会立即生效的,但重起机器会丢失,需要重新配置
如果需要一次配置就需要改动 /etc/network/interfaces 这个文件!
可以用来查看网络接口也可以用来配置网络
ifconfig <网络接口> <ip> [<Mask><Broadcast>]
如:ifconfig eth0 192.168.0.1 (命令启动eth0接口,并设置ip为192.168.0.1,子网为255.255.255.0
广播为192.168.0.255 )
当ip地址使用标准A.B.C类地址,子网,广播系统会自动判断,可以省略
如果有需要如:
ifconfig eth0 10.0.0.10 Mask 255.255.255.0 Broadcast 10.0.0.255
最后还需要注意,用ifconfig配置网络是会立即生效的,但重起机器会丢失,需要重新配置
如果需要一次配置就需要改动 /etc/network/interfaces 这个文件!
你能学会世界上所有语言来叫一种鸟的名字,当你知道所有这些名字叫法后,却对这种鸟一无所知~
理查德-费曼
理查德-费曼