LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-23-2003, 02:12 AM   #1
leongoogs
LQ Newbie
 
Registered: Nov 2003
Distribution: Red Hat 8.0, Mandrake 9.1 9.2
Posts: 23

Rep: Reputation: 16
Smile How to make network driver start at bootime


Running Red Hat 8.0 .

Have managed to build a new kernel for the on motherboard
gigbit Lan. 3c2000 . I can start the driver with insmod 3c2000.o
and I can see the eth0 device with ifconfig.

1/ How do I get the LAN driver to start at boot up ?

I also have managed get the USB adsl modem going as a tap() device.
I have a windows98SE machine on the LAN that I would like to share the ADSL modem . SE machine is 192.168.0.250 Linux box 192.168.0.1 .
I assume I need to put in a routing table for the eth0 to tap() . In gnome I can't see tap() as a device and the LAN driver doesn't look like the right one either. At command line all looks fine with ifconfig though.

2/ How to setup the router functions at command line?

3/ How do I make the devices appear correctly in the GUI?

I can ping from the each side so the hardware and drivers do work and the linux box can ping www's and back to the SE machine.

Thanks in advance .

 
Old 11-23-2003, 04:55 AM   #2
scott_R
Member
 
Registered: Jul 2003
Location: Brighton, Michigan, USA
Distribution: Lots of distros in the past, now Linux Mint
Posts: 746

Rep: Reputation: 31
Okay, I'm not using redhat, but here's a general guess...add grains of salt as needed. Insmod should have been permanent, but your can try the same thing using 'modprobe 3c2000' instead, and that should stay loaded.

Aside from the "easy" GUI approach, 'man route' should give you some hints, and it may be as easy as 'route -add <###.###.###.###>'

Once they're seen in the CLI, the GUI should pick them up automatically, as long as the GUI'd user has permission to access them.
 
Old 11-23-2003, 05:28 AM   #3
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
From what I remember of Red Hat:

1/ You need to create this script and chmod 777 it: /etc/sysconfig/network-scripts/ifcfg-eth0
Code:
# start eth0 on boot
DEVICE=eth0
BOOTPROTO=dhcp  #get ip address from your isp dhcp server
ONBOOT=yes
I think you may also need to load your eth0 module by inserting the following line in /etc/modules.conf
Code:
alias eth0 3c2000
2/ With respect to sharing your ADSL connection, I understand your LAN as follows:

ADSL modem --> (eth0) Linux Box (eth1) --> Windows Box

You stated that your Linux box can ping to your Windows box, so obviously you have configured your eth1 properly.

To share your ADSL connection, your Linux box will act as a router. Use iptables to do NAT ip masquerading. Create (and chmod 777) /etc/init.d/iptables:
Code:
IPTABLES='/sbin/iptables'

# load iptables modules
/sbin/modprobe iptable_nat
/sbin/modprobe ip_conntrack

# enable ip forwarding
/bin/echo 1 > /proc/sys/net/ipv4/ip_forward

# flush tables
$IPTABLES -F
$IPTABLES -X

# enable masquerading to allow LAN internet access
$IPTABLES -t nat -A POSTROUTING -o eth0 -j MASQUERADE

# forward LAN traffic from eth1 to eth0
$IPTABLES -A FORWARD -i eth1 -o eth0 -m state --state NEW,ESTABLISHED -j ACCEPT

# block out internet intrusion on eth0
$IPTABLES -A INPUT -i eth0 -m state --state NEW,INVALID -j DROP
$IPTABLES -A FORWARD -i eth0 -m state --state NEW,INVALID -j DROP
The above is a simple iptables script that will allow internet sharing on a home LAN. If you search this site for "iptables" and/or "firewall" you will find examples of more complex iptables scripts. Also search under user "mychl".

3/ I don't know what you mean by making the devices appear correctly in the GUI. Do you mean having your Linux box appear in Windows' Network Neighbourhood, or displaying your Windows shares on your Linux box? If so, then you need to search this site for "samba" and "linneighbourhood". I don't network with any Windows machines, so I can't help you here.
 
Old 11-23-2003, 05:54 AM   #4
leongoogs
LQ Newbie
 
Registered: Nov 2003
Distribution: Red Hat 8.0, Mandrake 9.1 9.2
Posts: 23

Original Poster
Rep: Reputation: 16
Thanks for the responses .

Just Clarifying .

There is ONE ethernet LAN connection between the two machines ,
eth0 . The ADSL modem is a D-Link200 a USB modem, in ifconfig it is identified as tap() not as eth1 or similar. The GUI doesn't seem to have a clue about tap() .

ADSL D-Link200 -----USB----->>Tap()--LinuxBox----eth0------>>Win98SEBox

ADSL is fixed IP address also so no DHCP.

I should be able to piece together the gaps from your posting I think.
I will do some reading on what chmod does.

Will have a play with it tomorrow night . Thanks .
 
Old 11-23-2003, 06:21 AM   #5
spurious
Member
 
Registered: Apr 2003
Location: Vancouver, BC
Distribution: Slackware, Ubuntu
Posts: 558

Rep: Reputation: 31
If you have a fixed IP, then your ifcfg-eth0 script will be as follows:

DEVICE=eth1
ONBOOT=yes
IPADDR=192.168.0.1 # insert your IP address here
NETMASK=255.255.255.0
BROADCAST=192.168.0.255 # insert proper value here
NETWORK=192.168.0.0 # insert proper value here

You will also need to edit /etc/sysconfig/network:

NETWORKING=yes
FORWARD_IPV4=true
HOSTNAME=yourhostname
DOMAINNAME=yourdomainname
GATEWAY=192.168.20.254 # insert IP address for your usb tap() nic.

Last edited by spurious; 11-23-2003 at 06:25 AM.
 
  


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
Gentoo dhcpcd bootime lockup mconroy Linux - Newbie 1 07-09-2005 11:49 PM
Network Wont Start, VIA Rhine fast II ethernet driver Simon7891 Linux - Hardware 3 02-06-2005 04:45 AM
ndiswrapper at bootime donbellioni Linux - Software 1 08-20-2004 01:37 PM
Can I gett KPPP to start when I start a browser on a network machine? duffboygrim Linux - Networking 0 03-25-2004 04:49 PM
Filesystem check at bootime firestomper41 Mandriva 5 03-20-2004 11:07 AM


All times are GMT -5. The time now is 04:47 PM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration