LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 07-10-2010, 01:26 AM   #1
fahedakhter
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Rep: Reputation: 0
how to assign an alternate ip address on same lan card


I am running Linux AS4 Update version. I have one lan card and the primary IP-Address is 192.168.0.215 & subnet is 255.255.255.0

Now I want to assign an alternative IP-Address on the same card & the IP I want to assign is 192.168.15.215.

I run the following command from root user
ifconfig eth0:1 192.168.15.215 netmask 255.255.255.0 up

Now when I ping this IP 192.168.15.215 From Windows machine then its reply me & properly reply comming from this Ip. But when I want to access this Ip by \\192.168.15.215 from run prompt then it gave me error.
The specified network name is no longer available..

I already restart the machine & network service but the problem remains same.

Please guide.
 
Old 07-10-2010, 01:31 AM   #2
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
You should make sure to start samba AFTER the address is added, so it binds to it.
 
Old 07-10-2010, 01:41 AM   #3
fahedakhter
LQ Newbie
 
Registered: Jun 2010
Posts: 8

Original Poster
Rep: Reputation: 0
I restart the samba service but nothing happens with problem.
 
Old 07-10-2010, 01:53 AM   #4
zirias
Member
 
Registered: Jun 2010
Posts: 361

Rep: Reputation: 59
Then check the samba config. Maybe it binds explicitly to eth0's address (and not to 0.0.0.0). Another thing to check are packet filtering rules (iptables).
 
Old 07-10-2010, 01:54 AM   #5
abakhiet
Member
 
Registered: Apr 2010
Location: Assiut, Egypt
Posts: 166

Rep: Reputation: 15
Wink

Quote:
Originally Posted by fahedakhter View Post
I restart the samba service but nothing happens with problem.

i think, you shold add a virtula interface
 
Old 07-10-2010, 12:46 PM   #6
barghota
Member
 
Registered: Jul 2003
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Debian, FreeBSD
Posts: 94

Rep: Reputation: 38
First you will have to define a virtual interface to have that interface available on every reboot...

# cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:0

and edit the new file ifcfg-eth0:0 with the desired configuration. Then make sure that samba bind to all interfaces...

# vi /etc/samba/smb.conf

and make sure you have

Quote:
hosts allow = 192.168. 127.
bind interfaces only = no
 
  


Reply



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
Program to assign globa lIPv6 address and bind() to the previously assigned address. mwnn Linux - Networking 2 10-07-2010 02:29 AM
How to assign IP address to 2nd ethernet card gardenair Linux - Newbie 8 06-22-2010 07:47 AM
how to assign an alternate ip address in bonding interface. cj_cheema Linux - Server 4 07-10-2009 09:15 AM
Cannot Assign an IP address in my LAN IP range amilauduwerella Linux - Hardware 8 05-21-2009 11:42 PM
How can I set 1 lan card host 2 IP address? combilli Linux - Networking 1 02-15-2007 10:21 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 08:19 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