LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > *BSD
User Name
Password
*BSD This forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.

Notices


Reply
  Search this Thread
Old 09-08-2004, 08:58 AM   #1
january
LQ Newbie
 
Registered: Aug 2004
Posts: 14

Rep: Reputation: 0
how to set multiple IP over one ethernet


I want to use one of my eth card as a gate , could any one tell me how to set it up.
rl0:1
rl0:2 seems not a valid device name, where can i find a legal name for it, or how to create one.

thanks
 
Old 09-08-2004, 01:15 PM   #2
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
january, please do not hijack other posters' threads with your own questions. Start your own thread in the appropriate forum.

OK, now what BSD are you using, and what is the output of
$ ifconfig -a

?
 
Old 09-09-2004, 09:21 AM   #3
january
LQ Newbie
 
Registered: Aug 2004
Posts: 14

Original Poster
Rep: Reputation: 0
Sorry, sincerely! I don't meant to disturb the forum.

the out put was as following,

I've tried aix on IBM, it troubles me with the same question.
perviously , i did the same thing on slackware, redhat , mandrake
it can be configured with
ifconfig eth1:1.......
but on freeBSD or AIX I can not find the way
can you tell me what part should i study.
Thanks!


# ifconfig -a
xl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=b<RXCSUM,TXCSUM,VLAN_MTU>
inet 211.71.132.116 netmask 0xffffff00 broadcast 211.71.132.255
inet6 fe80::201:2ff:fe91:412e%xl0 prefixlen 64 scopeid 0x1
ether 00:01:02:91:41:2e
media: Ethernet autoselect (100baseTX <full-duplex>)
status: active
rl0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 1500
options=8<VLAN_MTU>
inet6 fe80::240:95ff:fe07:e3de%rl0 prefixlen 64 scopeid 0x2
inet 10.9.15.251 netmask 0xff000000 broadcast 10.9.15.255
ether 00:40:95:07:e3:de
media: Ethernet autoselect (10baseT/UTP)
status: active
plip0: flags=8810<POINTOPOINT,SIMPLEX,MULTICAST> mtu 1500
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
inet 127.0.0.1 netmask 0xff000000
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
#

# netstat -i
Name Mtu Network Address Ipkts Ierrs Opkts Oerrs Coll
xl0 1500 <Link#1> 00:01:02:91:41:2e 123298 0 2934 0 0
xl0 1500 211.71.132 bms 12680 - 2795 - -
xl0 1500 fe80:1::201:2 fe80:1::201:2ff:f 0 - 6 - -
rl0 1500 <Link#2> 00:40:95:07:e3:de 243896 0 2114 0 2
rl0 1500 fe80:2::240:9 fe80:2::240:95ff: 0 - 4 - -
rl0 1500 10 10.9.15.251 3 - 4 - -
plip0 1500 <Link#3> 0 0 0 0 0
lo0 16384 <Link#4> 436 0 436 0 0
lo0 16384 your-net localhost 381 - 381 - -
lo0 16384 localhost.cad ::1 0 - 0 - -
lo0 16384 fe80:4::1 fe80:4::1 0 - 0 - -
 
Old 09-09-2004, 04:15 PM   #4
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Your network cards are xl0 and rl0. UNIX uses the driver name to enumerate interfaces, unlike Windows and Linux which just use generic interface names. On a UNIX or BSD based system network cards are numbered like this:

driverX0
driverX1
driverS0
driverA0
etc...

Also, UNIX systems don't use interfaceN:N to describe aliases (that notation actually indicates VLAN, on some BSDs).
 
Old 09-09-2004, 11:41 PM   #5
january
LQ Newbie
 
Registered: Aug 2004
Posts: 14

Original Poster
Rep: Reputation: 0
Could you show me how to create that alias
for dual IP on one eth card ( for freeBSD )?

Thanks
 
Old 09-10-2004, 12:34 AM   #6
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Have you tried reading the man page for ifconfig(8), by any chance? It should be pretty obvious if you have. It's exactly the same as normal ifconfig, only you add "alias" to the end. If you want to do this automatically at boot time, you can add the full ifconfig command for the alias into /etc/rc.local. That method is now deprecated (but it's the easiest). Check the rc(8) man page for more options.
 
Old 09-10-2004, 03:46 AM   #7
january
LQ Newbie
 
Registered: Aug 2004
Posts: 14

Original Poster
Rep: Reputation: 0
Yes , I did look the man about ifconfig but tried in vain

ifconfig rl0 xxx.xx.xxx.xx mask.mask.mask.mask alias
ifconfig: ioctl (SIOCAIFADDR): File exists ???????????

I also tried put some line in rc.conf
ifconfig_rl0_alias0="xxx.xx.xx.xx netmask mask.mask.mask.mask media 10baseT/UTP"

what's wrong with my command ?
Thanks
 
Old 09-11-2004, 12:07 AM   #8
chort
Senior Member
 
Registered: Jul 2003
Location: Silicon Valley, USA
Distribution: OpenBSD 4.6, OS X 10.6.2, CentOS 4 & 5
Posts: 3,660

Rep: Reputation: 76
Are you trying to assign the same IP to two NICs, or assign it twice to the same NIC?
 
Old 09-12-2004, 09:32 AM   #9
january
LQ Newbie
 
Registered: Aug 2004
Posts: 14

Original Poster
Rep: Reputation: 0
I have two ethernet card and
want to assign two different group of IP to the same ETH card ( rl0 )

for ex.

freeBSD xl0 ---- 1.2.3.45
rl0 ---- 10.9.10.250
|
|
---- 10.9.20.250

Thanks
 
Old 09-13-2004, 08:17 AM   #10
january
LQ Newbie
 
Registered: Aug 2004
Posts: 14

Original Poster
Rep: Reputation: 0
perform the following steps then it seems work.

1>new file as following
cat /etc/hostname.rl0
inet 192.168.200.1 255.255.255.0
inet alias 192.168.210.1 255.255.255.0

2>
ifconfig rl0 inet alias 192.168.210.1 netmask 255.255.255.0

restart again and it works
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Setting up another eth card, to be used for a Router slacker101 Linux - Networking 1 06-21-2005 12:47 AM
Realtek 8139 eth card help plm Slackware 36 10-13-2003 10:33 AM
eth card data transfer rates h/w Programming 3 10-11-2003 11:24 AM
Help: install I-Gate 11m PCI wireless card TheoZhang Linux - Hardware 1 08-27-2003 11:20 AM
eth card need help and info isalt Linux - Hardware 2 01-30-2003 08:27 AM

LinuxQuestions.org > Forums > Other *NIX Forums > *BSD

All times are GMT -5. The time now is 06:59 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration