[LCP]A doubt in Linux --- Please help
J.Saravanan
saran at nimbus.tenet.res.in
Fri Jul 27 14:41:08 UTC 2001
Hi,
Take a look at the following file.
linux/net/ipv4/ipconfig.c under your source tree.
In this file you can hardcode the ip address for eth0.
The parameters to touch are..
u32 ic_myaddr __initdata = INADDR_NONE; /* My IP address */
u32 ic_servaddr __initdata = INADDR_NONE; /* Server IP address */
u32 ic_gateway __initdata = INADDR_NONE; /* Gateway IP address */
u32 ic_netmask __initdata = INADDR_NONE; /* Netmask for local
subnet */
int ic_set_manually __initdata = 0; /* IPconfig parameters set
manually */
u32 root_server_addr __initdata = INADDR_NONE; /* Address of boot
server */
Remove all INADDR_NONE and put apropriate ip address and toggle IPconfig
parameters flag above.
For ex. INADDR_NONE to be replace with 0x0000ffff for Netmask param.
Regards,
_Saran_
On Thu, 26 Jul 2001, rahul pande wrote:
> Hello All,
>
> I am experimenting with using "initrd" to have two stage booting, on a
> diskless machine. My intension is to get the file system to be mounted as
> root from a remote machine. The plan is to use "tftp" client to get the root
> file system from the remote machine. To accomplish the above I need to
> assign an IP Address (NIC driver is built in the image) to the diskless
> machine, so that "tftp" can be used in the network. All the above should
> happen before the "init" is called. Can someone give advice as to how i can
> assign an IP Address or configure the network for the diskless machine in
> the above scenario.
>
> I tried using "ifconfig eth0 <ip address> up" in /linuxrc file but it failed
> giving some modprobe (kmod) error.
>
> Waiting for ur response.
>
> Thanks and Regards,
> rahul
>
More information about the linuxCprogramming
mailing list