当前位置: 首页 > 图文教程 > 操作系统 > Unix/Linux > FreeBSD操作系统下修改ip地址及捆定多个IP地址

Unix/Linux
第三章 在Debian上用Exim配置邮件服务器
Sendmail邮件服务器快速指南 1
Sendmail邮件服务器快速指南 2
Sendmail邮件服务器快速指南 3
使用sendmail配置企业简易邮件系统
RedHatLinux AS3中配置sendmail服务器
RedHatLinux AS3中APACHE+SendMail+OpenWebMail整合
Linux下DNS服务器架设攻略
Linux下DNS服务器架设攻略 2
Linux下DNS服务器架设攻略 3
Linux内核配置选项
域名解析 A记录 MX记录 CNAME记录 TTL
DNS轮循的一些介绍
netfilter/iptables模块编译及应用
和大家一起分享不错的iptables
构筑Linux防火墙之IPtables的概念与用法(1)
构筑Linux防火墙之IPtables的概念与用法(2)
Linux架设DNS服务器(一)
Linux架设DNS服务器(二)
邮件传输原理及相关入门知识概述

Unix/Linux 中的 FreeBSD操作系统下修改ip地址及捆定多个IP地址


出处:互联网   整理: 软晨网(RuanChen.com)   发布: 2010-01-15   浏览: 92 ::
收藏到网摘: n/a

 1.临时更改,即时生效.

[root@freebsd7]# ifconfig
le0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        options=8<VLAN_MTU>
        ether 00:0c:29:21:2d:a6
        inet 192.168.1.106 netmask 0xffffff00 broadcast 192.168.1.255
        media: Ethernet autoselect
        status: active
plip0: flags=108810<POINTOPOINT,SIMPLEX,MULTICAST,NEEDSGIANT> metric 0 mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
        inet6 fe80::1%lo0 prefixlen 64 scopeid 0x3
        inet6 ::1 prefixlen 128
        inet 127.0.0.1 netmask 0xff000000

Freebsd# ifconfig le0 10.0.0.123 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.rhel5.com"
ifconfig_lnc0="inet 10.0.0.123  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"