Trilight Zone Forum Index Trilight Zone
Privacy & Anonymity is our speciality !
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FreeBSD > How to setup 2 IP address on One NIC

 
Post new topic   Reply to topic    Trilight Zone Forum Index -> Other Unix
Author Message
thedark
Second Lieutenant


Joined: 30 Jul 2005
Posts: 1074

PostPosted: Sun Jul 31, 2005 8:04 am    Post subject: FreeBSD > How to setup 2 IP address on One NIC Reply with quote

It is possible to create network alias or assign 2 ip address to single NIC under FreeBSD.

My setup:
lnc0 - IP : 192.168.1.1/255.255.255.0
lnc0 alias - IP : 192.168.1.5/255.255.255.255

Note: Netmask must be diffrent otherwise you will get an error ifconfig: ioctl (SIOCAIFADDR): File exists

A) From command line use ifconfig command as follows:
# ifconfig lnc0 192.168.1.5 netmask 255.255.255.255 alias

B) You can setup this alias in /etc/rc.conf file by appending following text, so that next time FreeBSD comes up (after restart/shutdown) it will create alias for you:
ifconfig_lnc0_alias0="192.168.1.5 netmask 255.255.255.255"

C)Restart FreeBSD network service using following script:
# /etc/netstart

D) Display alias and real ip using ifconfig lnc0 command:
# ifconfig lnc0
lnc0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
inet6 fe80::20c:29ff:fe01:ddbd%lnc0 prefixlen 64 scopeid 0x1
inet 192.168.1.2 netmask 0xffffff00 broadcast 192.168.1.255
inet 192.168.1.5 netmask 0xffff
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Trilight Zone Forum Index -> Other Unix All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group