linux初探

首页

应用服务器

Linux技巧

中文文档

Linux初级

服务器源代码

命令详解

Linux技术应用

Linux安全应用

Linux业界新闻

UniX技术文章

Linux编程与内核

Linux数据库

Linux服务器

Linux安装指导

Linux论坛

首页>>UniX技术文章>>文章正文

FreeBSD下修改ip地址及多IP地址捆定

暂时只会两种方法:

1.
Freebsd# ifconfig
lnc0: flags=108843 mtu 1500
inet6 fe80::20c:29ff:fe7b:3dcd%lnc0 prefixlen 64 scopeid 0x1
inet 10.0.0.199 netmask 0xffffff00 broadcast 10.0.0.255
ether 00:0c:29:7b:3d:cd
plip0: flags=108810 mtu 1500
lo0: flags=8049 mtu 16384
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
inet 127.0.0.1 netmask 0xff000000
Freebsd# ifconfig lnc0 10.0.0.111 netmask 255.255.255.0

这种方法即时生效,但是重启机器后,信息不保留。

2.
打开/etc/rc.conf
加入或修改:ifconfig_网卡名称="inet x.x.x.x netmask x.x.x.x"
之后 reboot 或 #sh /etc/rc

Freebsd# more /etc/rc.conf

# -- sysinstall generated deltas -- # Thu Oct 12 09:37:56 2006
# Created: Thu Oct 12 09:37:56 2006
# Enable network daemons for user convenience.
# Please make all changes to this file, not to /etc/defaults/rc.conf.
# This file now contains just the overrides from /etc/defaults/rc.conf.
defaultrouter="10.0.0.1"
hostname="Freebsd.lzyq.org"
ifconfig_lnc0="inet 10.0.0.199 netmask 255.255.255.0"
keymap="us.iso"
linux_enable="YES"
sshd_enable="YES"
Freebsd#
这种方法,信息永久保留,但是修改完需要重启机器。

如果要设置多IP地址可用别名方式作修改如下

ifconfig_lnc0="inet 10.0.0.199 netmask 255.255.255.0"
改为

ifconfig_lnc0_alias0="inet 10.0.0.198 netmask 255.255.255.0"
ifconfig_lnc0_alias1="inet 10.0.0.197 netmask 255.255.255.0"

相关文章

·solaris学习日记-张光盘其余硬盘安装solaris10
·solaris学习日记三基本网络路由命令
·solaris学习日记二打开SSH及使命令补全解决方法
·FreeBSD的一些重要配置文件
·修改solaris 8系统的ip和网关
·UNIX操作系统概要
·FreeBSD磁盘有写保护解决
·曾经毁了我整个系统的误操作(boot0cfg)
·UNIX系统的关机方法创建关机用户bye

热门文章

·第n个命令级集
·/usr/pkgsrc/devel/devhelp的
·中文Firefox安装
·我的FB6.1内核优化
·为FreeBSD添加新硬盘!
·freebsd平台下配置vhcs2教程
·freebsd内核详解
·我的debian VS FreeBSD
·Unix AWK 总结
·在AIX中如何对用户卷组进行卷

Copyright@2005 www.linuxGoo.com All Right Reserved