DaemonForums  

Go Back   DaemonForums > Other Operating Systems > Solaris

Solaris SUN Solaris & OpenSolaris.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 22nd August 2010
bsdplus bsdplus is offline
Real Name: Alan Cheng
Port Guard
 
Join Date: Jun 2009
Location: Shanghai, China
Posts: 21
Thanked 0 Times in 0 Posts
Default How to add static route using virtual NIC

Hello,

I'd like to add a route on a solaris 10 for the multicast subnet (224.0.0.0) using virtual NIC device, but was not able to do so. "route add" command can add a routing entry using physical NIC. Any help or advices on how to do that on a virtual NIC are appreciated.

some backgroup information:

Here is a solaris 10 that has such route entry configured already, but don't konw how it was done:
$ netstat -rn

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
default 10.15.44.1 UG 1 191974
10.15.44.0 10.15.44.227 U 1 762935 e1000g0:1
10.15.44.0 10.15.44.207 U 1 0 e1000g0
10.15.44.0 10.15.44.207 U 1 619630 e1000g3
224.0.0.0 10.15.44.227 U 1 0 e1000g0:1 ### (This entry is what I want on another machine)
127.0.0.1 127.0.0.1 UH 6 331210 lo0

NIC configuration on the machine that I want to add static route on:
$ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv 4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=209040843<UP,BROADCAST,RUNNING,MULTICAST,DEP RECATED,IPv4,NOFAILOVER,CoS> mtu 1500 index 2
inet 10.15.44.206 netmask ffffff00 broadcast 10.15.44.255
groupname net1
e1000g0:1: flags=201000843<UP,BROADCAST,RUNNING,MULTICAST,IPv 4,CoS> mtu 1500 index 2
inet 10.15.44.233 netmask ffffff00 broadcast 10.15.44.255
e1000g3: flags=209040843<UP,BROADCAST,RUNNING,MULTICAST,DEP RECATED,IPv4,NOFAILOVER,CoS> mtu 1500 index 3
inet 10.15.44.213 netmask ffffff00 broadcast 10.15.44.255
groupname net1

routing table on the machine I want to add route:
$ route -p show
No persistent routes are defined$ netstat -rn

I tried the following, but "netstat -rn" shows its interface is still e1000g0:

route add -net 224.0.0.0 -netmask 240.0.0.0 10.15.44.233 -ifp e1000g0:1 ( this will add route using device e1000g0, instead of e1000g0:1)
Reply With Quote
  #2   (View Single Post)  
Old 22nd August 2010
bsdplus bsdplus is offline
Real Name: Alan Cheng
Port Guard
 
Join Date: Jun 2009
Location: Shanghai, China
Posts: 21
Thanked 0 Times in 0 Posts
Smile

Finally worked this out. "route -n add -interface 224.0/4 -gateway [virtual_nic_ip]" did the trick. FYI.

here is on a test machine:

bash-3.00# netstat -rn

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
10.181.8.0 10.181.8.161 U 1 1027 e1000g0
10.181.8.0 10.181.8.172 U 1 0 e1000g0:1
127.0.0.1 127.0.0.1 UH 3 56 lo0
bash-3.00# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv 4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.181.8.161 netmask ffffff00 broadcast 10.181.8.255
ether 0:c:29:f9:c3:d
e1000g0:1: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 10.181.8.172 netmask ffffff00 broadcast 10.181.8.255
--------------------------------------------------------------------------
bash-3.00# route -n add -interface 224.0/4 -gateway 10.181.8.172
add net 224.0/4: gateway 10.181.8.172
--------------------------------------------------------------------------
bash-3.00# netstat -rn

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
10.181.8.0 10.181.8.161 U 1 1034 e1000g0
10.181.8.0 10.181.8.172 U 1 0 e1000g0:1
224.0.0.0 10.181.8.172 U 1 0 e1000g0:1
127.0.0.1 127.0.0.1 UH 3 56 lo0
bash-3.00#
Reply With Quote
Reply

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ping: sendto: No route to host joostvgh OpenBSD General 2 29th April 2010 12:34 PM
problem with static v4 IPs texaganian OpenBSD General 9 8th March 2010 11:29 AM
snd_emu10k1 and static kly FreeBSD General 3 17th September 2009 01:28 PM
Static IP address problem rex FreeBSD General 2 25th November 2008 08:53 PM
Cannot assign static IP. bsdnewbie999 OpenBSD General 5 21st June 2008 09:50 AM


All times are GMT. The time now is 02:13 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick