Koozali.org: home of the SME Server

usb nic

Offline GPete

  • *
  • 38
  • +0/-0
    • http://aaahomebase.com
usb nic
« on: November 30, 2007, 08:57:14 PM »
continuing from
    http://forums.contribs.org/index.php?topic=38015.0
I want to use a usf (tiny) Dell that offers USB slots, no PCI.
It is on-line with the on-board nic, but that is not appropriate for direct internet.
modprobe pegasus
confirms that I have a usb nic at eth1,and that the IP address etc that I put in ifcfg-eth1 are being used.

But when I go to configure the server it says I only have one nic.

Charlie Brady said that "Yes, it can be made to work if you are prepared to do some tricky customisation."

How tricky do I have to get?

Thanks for any help.
  GP

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: usb nic
« Reply #1 on: December 02, 2007, 05:04:35 PM »
I believe that this issue could be solved rather easy as a standard Linux configuration issue, and that this solution would work quite well.

If anyone suggest or makes standard Linux configurations on the SME server like this, there will normally be a lot of negative comments and flaming in this tread.

I think that it would be a good idea if some of the "sme server purists" came up with some suggestions how to solve things this way.

« Last Edit: December 02, 2007, 05:18:50 PM by arne »
......

Offline byte

  • *
  • 2,183
  • +2/-0
Re: usb nic
« Reply #2 on: December 02, 2007, 05:26:18 PM »
I believe that this issue could be solved rather easy as a standard Linux configuration issue, and that this solution would work quite well.

OK, then give it a go.

Quote
If anyone suggest or makes standard Linux configurations on the SME server like this, there will normally be a lot of negative comments and flaming in this tread.

No thats incorrect you was making a change in firewall config which is a major configuration change, this poster is asking how to use a USB network adapter.

Quote
I think that it would be a good idea if some of the "sme server purists" came up with some suggestions how to solve things this way.

Again why don't you come up with the "magic" to make this work ?!
--[byte]--

Have you filled in a Bug Report over @ http://bugs.contribs.org ? Please don't wait to be told this way you help us to help you/others - Thanks!

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: usb nic
« Reply #3 on: December 03, 2007, 10:51:46 PM »
Quote
No thats incorrect you was making a change in firewall config which is a major configuration change, this poster is asking how to use a USB network adapter.

I do not agree on that statement. That should eventually be the magic.
......

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: usb nic
« Reply #4 on: December 03, 2007, 11:03:56 PM »
GPete ->

Could you load the network kernel module and insert the USB network adapter.

Write a few words about the installation of the USB network adapter and how you loaded the driver module.

Please run these commands and post output here.

1.  dmesg | tail

2. dmesg | grep eth

3. lsmod

4. ifconfig -a

5. iptables -L -n

I could try to look into it and see if I got any ideas ..

******
Just a reminder for later use ..
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/en-US/System_Administration_Guide/Kernel_Modules.html

Some more refferences:
http://forums.contribs.org/index.php?topic=39300.0
http://forums.contribs.org/index.php?topic=38015.0
« Last Edit: December 04, 2007, 12:47:14 AM by arne »
......

Offline GPete

  • *
  • 38
  • +0/-0
    • http://aaahomebase.com
Re: usb nic
« Reply #5 on: December 04, 2007, 12:54:08 AM »
1st: Thanks for the effort, regardless of the outcome. ("magic" or not)

2nd:from the message log:
kernel: usb 5-1: new full speed USB device using address 2
kernel: drivers/usb/net/pegasus.c: v0.5.12 (2003/06/06):Pegasus/Pegasus II USB Ethernet driver
kernel: drivers/usb/net/pegasus.c: intr interval will be changed from 1ms to 128ms
kernel: drivers/usb/net/pegasus.c: setup Pegasus II specific registers
kernel: divert: allocating divert_blk for eth1
kernel: eth1: ADMtek ADM8511 "Pegasus II" USB Ethernet
kernel: usbcore: registered new driver pegasus

     "native " driver?

3rd:
dmesg|tail
usbcore: deregistering driver pegasus
divert: freeing divert_blk for eth1
drivers/usb/net/pegasus.c:v0.5.12 (2003/06/06) :Pegasus/Pegasus II USB Ethernet driver
drivers/usb/net/pegasus.c: intr interval will be changed from 1ms to 128ms
drivers/usb/net/pegasus.c: setup Pegasus II specific registers
divert: allocating divert_blk for eth1
eth1: ADMtek ADM8511 "PegasusII" USB Ethernet
usbcore: registered new driver pegasus
parport0: PC-style at 0x378 (0x778) [PCSPP,TRISTATE]
parport0: irq 7 detected

 dmesg|grep eth
divert: not allocating divert_blk for non-ethernet device lo
divert: allocating divert_blk for eth0
eth0: Tigon3 [partno(BCM5751PKFBG) rev 4001 PHY(5750)] (PCI Express) 10/100/1000BaseT Ethernet 00:12:3f:8f:a0:a0
eth0: RXcsums[1] LinkChgREG[1] MIirq[1] ASF[0] Split[0] WireSpeed[1] TSOcap[1]
eth0: dma_rwctrl[76180000] dma_mask[64-bit]
divert: allocating divert_blk for eth1
eth1: ADMtek ADM8511 "Pegasus II" USB Ethernet
divert: freeing divert_blk for eth1
divert: freeing divert_blk for eth0
divert: allocating divert_blk for eth0
eth0: Tigon3 [partno(BCM5751PKFBG) rev 4001 PHY(5750)] (PCI Express) 10/100/1000BaseT Ethernet 00:12:3f:8f:a0:a0
eth0: RXcsums[1] LinkChgREG[1] MIirq[1] ASF[0] Split[0] WireSpeed[1] TSOcap[1]
eth0: dma_rwctrl[76180000] dma_mask[64-bit]
tg3: eth0: Link is up at 100 Mbps, full duplex.
tg3: eth0: Flow control is on for TX and on for RX.
divert: allocating divert_blk for eth1
eth1: ADMtek ADM8511 "Pegasus II" USB Ethernet
divert: freeing divert_blk for eth1
divert: allocating divert_blk for eth1
eth1: ADMtek ADM8511 "Pegasus II" USB Ethernet

lsmod
Module                  Size  Used by
pegasus                26957  0
appletalk              38996  20
tg3                   102853  0
ipt_ULOG               11845  1
ipt_REJECT             10689  1
ipt_MASQUERADE          8001  1
ipt_state               5953  1
ip_nat_ftp              9009  0
ip_conntrack_ftp       76529  1 ip_nat_ftp
iptable_mangle          6849  0
iptable_nat            27613  3 ipt_MASQUERADE,ip_nat_ftp
ip_conntrack           46085  5 ipt_MASQUERADE,ipt_state,ip_nat_ftp,ip_conntrack_ftp,iptable_nat
iptable_filter          6977  1
ip_tables              22721  7 ipt_ULOG,ipt_REJECT,ipt_MASQUERADE,ipt_state,iptable_mangle,iptable_nat,iptable_filter
loop                   20681  0
button                 10705  0
battery                12997  0
ac                      8901  0
uhci_hcd               33241  0
ehci_hcd               32325  0
hw_random               9685  0
snd_intel8x0           35049  0
snd_ac97_codec         65425  1 snd_intel8x0
snd_pcm_oss            52729  0
snd_mixer_oss          21953  1 snd_pcm_oss
snd_pcm                92357  2 snd_intel8x0,snd_pcm_oss
snd_timer              28229  1 snd_pcm
snd_page_alloc         14541  2 snd_intel8x0,snd_pcm
snd_mpu401_uart        11457  1 snd_intel8x0
snd_rawmidi            28005  1 snd_mpu401_uart
snd_seq_device         12105  1 snd_rawmidi
snd                    57509  9 snd_intel8x0,snd_ac97_codec,snd_pcm_oss,snd_mixer_oss,snd_pcm,snd_timer,snd_mpu401_uart,snd_rawmidi,snd_seq_device
soundcore              13089  1 snd
bonding                65896  0
dm_snapshot            21093  0
dm_zero                 6337  0
dm_mirror              31173  0
ext3                  119113  2
jbd                    59609  1 ext3
raid1                  19777  2
dm_mod                 64617  8 dm_snapshot,dm_zero,dm_mirror
ata_piix               19013  1
libata                105757  1 ata_piix
sd_mod                 20545  3
scsi_mod              119757  2 libata,sd_mod

ifconfig -a
bond0     Link encap:Ethernet  HWaddr 00:00:00:00:00:00
          BROADCAST MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

eth0      Link encap:Ethernet  HWaddr x:x:x:x:x:A0
          inet addr:x.x.x.229  Bcast:x.x.x.231  Mask:255.255.255.248
          UP BROADCAST RUNNING ALLMULTI MULTICAST  MTU:1500  Metric:1
          RX packets:8234 errors:0 dropped:0 overruns:0 frame:0
          TX packets:7411 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1143878 (1.0 MiB)  TX bytes:4504290 (4.2 MiB)
          Interrupt:169

eth1      Link encap:Ethernet  HWaddr 00:40:F4:EB:35:46
          inet addr:192.168.0.19  Bcast:192.168.0.101  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1536  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:1353 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1353 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:120854 (118.0 KiB)  TX bytes:120854 (118.0 KiB)


iptables -L -n
Chain INPUT (policy DROP)
target     prot opt source               destination
state_chk  all  --  0.0.0.0/0            0.0.0.0/0
local_chk  all  --  0.0.0.0/0            0.0.0.0/0
PPPconn    all  --  0.0.0.0/0            0.0.0.0/0
denylog    all  --  224.0.0.0/4          0.0.0.0/0
denylog    all  --  0.0.0.0/0            224.0.0.0/4
InboundICMP  icmp --  0.0.0.0/0            0.0.0.0/0
denylog    icmp --  0.0.0.0/0            0.0.0.0/0
InboundTCP  tcp  --  0.0.0.0/0            0.0.0.0/0           tcp flags:0x16/0x02
denylog    tcp  --  0.0.0.0/0            0.0.0.0/0           tcp flags:0x16/0x02
InboundUDP  udp  --  0.0.0.0/0            0.0.0.0/0
denylog    udp  --  0.0.0.0/0            0.0.0.0/0
gre-in     47   --  0.0.0.0/0            0.0.0.0/0
denylog    47   --  0.0.0.0/0            0.0.0.0/0
denylog    all  --  0.0.0.0/0            0.0.0.0/0

Chain FORWARD (policy DROP)
target     prot opt source               destination
state_chk  all  --  0.0.0.0/0            0.0.0.0/0
local_chk  all  --  0.0.0.0/0            0.0.0.0/0
ForwardedTCP  tcp  --  0.0.0.0/0            0.0.0.0/0           tcp flags:0x16/0x02
ForwardedUDP  udp  --  0.0.0.0/0            0.0.0.0/0
denylog    all  --  0.0.0.0/0            0.0.0.0/0

Chain OUTPUT (policy ACCEPT)
target     prot opt source               destination
PPPconn    all  --  0.0.0.0/0            0.0.0.0/0
denylog    all  --  224.0.0.0/4          0.0.0.0/0
denylog    all  --  0.0.0.0/0            224.0.0.0/4
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0

Chain ForwardedTCP (1 references)
target     prot opt source               destination
ForwardedTCP_3230  all  --  0.0.0.0/0            0.0.0.0/0
denylog    tcp  --  0.0.0.0/0            0.0.0.0/0           tcp flags:0x16/0x02

Chain ForwardedTCP_3230 (1 references)
target     prot opt source               destination

Chain ForwardedUDP (1 references)
target     prot opt source               destination
ForwardedUDP_3230  all  --  0.0.0.0/0            0.0.0.0/0
denylog    udp  --  0.0.0.0/0            0.0.0.0/0

Chain ForwardedUDP_3230 (1 references)
target     prot opt source               destination

Chain InboundICMP (1 references)
target     prot opt source               destination
InboundICMP_3230  all  --  0.0.0.0/0            0.0.0.0/0
denylog    icmp --  0.0.0.0/0            0.0.0.0/0

Chain InboundICMP_3230 (1 references)
target     prot opt source               destination
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 8
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 0
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 3
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 4
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 11
ACCEPT     icmp --  0.0.0.0/0            0.0.0.0/0           icmp type 12
denylog    all  --  0.0.0.0/0            0.0.0.0/0

Chain InboundTCP (1 references)
target     prot opt source               destination
InboundTCP_3230  all  --  0.0.0.0/0            0.0.0.0/0
denylog    tcp  --  0.0.0.0/0            0.0.0.0/0           tcp flags:0x16/0x02

Chain InboundTCP_3230 (1 references)
target     prot opt source               destination
denylog    all  --  0.0.0.0/0           !x.x.x.229
REJECT     tcp  --  0.0.0.0/0            x.x.x.229       tcp dpt:113 reject-with tcp-reset
ACCEPT     tcp  --  0.0.0.0/0            x.x.x.229       tcp dpt:80
ACCEPT     tcp  --  0.0.0.0/0            x.x.x.229       tcp dpt:443
ACCEPT     tcp  --  0.0.0.0/0            x.x.x.229       tcp dpt:25
ACCEPT     tcp  --  0.0.0.0/0            x.x.x.229       tcp dpt:465

Chain InboundUDP (1 references)
target     prot opt source               destination
InboundUDP_3230  all  --  0.0.0.0/0            0.0.0.0/0
denylog    udp  --  0.0.0.0/0            0.0.0.0/0

Chain InboundUDP_3230 (1 references)
target     prot opt source               destination
denylog    all  --  0.0.0.0/0           !x.x.x.229

Chain PPPconn (2 references)
target     prot opt source               destination
PPPconn_1  all  --  0.0.0.0/0            0.0.0.0/0

Chain PPPconn_1 (1 references)
target     prot opt source               destination

Chain denylog (20 references)
target     prot opt source               destination
DROP       udp  --  0.0.0.0/0            0.0.0.0/0           udp dpt:520
DROP       udp  --  0.0.0.0/0            0.0.0.0/0           udp dpts:137:139
DROP       tcp  --  0.0.0.0/0            0.0.0.0/0           tcp dpts:137:139
ULOG       all  --  0.0.0.0/0            0.0.0.0/0           ULOG copy_range 0 nlgroup 1 prefix `denylog:' queue_threshold 1
DROP       all  --  0.0.0.0/0            0.0.0.0/0

Chain gre-in (1 references)
target     prot opt source               destination
denylog    all  --  0.0.0.0/0           !x.x.x.229
denylog    all  --  0.0.0.0/0            0.0.0.0/0

Chain local_chk (2 references)
target     prot opt source               destination
local_chk_3230  all  --  0.0.0.0/0            0.0.0.0/0

Chain local_chk_3230 (1 references)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0
ACCEPT     all  --  x.x.x..224/29     0.0.0.0/0

Chain state_chk (2 references)
target     prot opt source               destination
ACCEPT     all  --  0.0.0.0/0            0.0.0.0/0           state RELATED,ESTABLISHED


(I will email the ip address to you if needed.)
Thanks again
  GP

Offline Stefano

  • *
  • 10,838
  • +2/-0
Re: usb nic
« Reply #6 on: December 04, 2007, 05:22:49 PM »
continuing from
    http://forums.contribs.org/index.php?topic=38015.0
I want to use a usf (tiny) Dell that offers USB slots, no PCI.
It is on-line with the on-board nic, but that is not appropriate for direct internet.
modprobe pegasus
confirms that I have a usb nic at eth1,and that the IP address etc that I put in ifcfg-eth1 are being used.

But when I go to configure the server it says I only have one nic.

Charlie Brady said that "Yes, it can be made to work if you are prepared to do some tricky customisation."

How tricky do I have to get?

Thanks for any help.
  GP

create a custom template to load pegasus module
then try
Code: [Select]
config setprop ExternalIP your_external_ip
config setprop ExternalNetmask your_netmask
config setprop EthernetDriver2 pegasus
config setprop GatewayIP your_gateway

config setprop ExternalInterface  Broadcast external_broad_address Configuration static Driver pegasus \
    Gateway your_gateway \
    IPAddress your_external_ip \
    Netmask your_netmask \
    Network your_external_network

config setprop SystemMode servergateway-private
config setprop sysconfig PreviousSystemMode servergateway-private

signal-event post-upgrade; signal-event reboot

not tested, should work

My 2C

Ciao
Stefano

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: usb nic
« Reply #7 on: December 04, 2007, 05:38:24 PM »
GPete ->

Your posting above shows that the configuration problem should be possible to solve.

The solution of nenonano looks like a good one (and a very intersting one) if it works.

I would suggest to give the nenonano solution first priority, because it looks like a soulution that is tightly integreated into the SME server automated config system, so that the "level of modification" or "change from the original" can be kept to a minimum.

Please also send me your ip on mail. My mail: arne22 at gmail dot com (Written this way to avoid spam.)

I would guess you will come up with a working solution, the one way or the other.

 
......

Offline GPete

  • *
  • 38
  • +0/-0
    • http://aaahomebase.com
Re: usb nic
« Reply #8 on: December 04, 2007, 06:27:04 PM »
OK, instructions followed and the server is still functional and on-line.
If this worked, eth0 is now configured as an external connection, right?
How do I test that?
       I found the test:
Review configuration
Networking Parameters
Server Mode   servergateway

Did I by-pass the GUI Admin screen and eliminate the need for the usb 2nd nic?

looks like a go for me

Thanks to all
   GP
« Last Edit: December 04, 2007, 06:44:26 PM by GPete »

Offline arne

  • ****
  • 1,116
  • +0/-4
Re: usb nic
« Reply #9 on: December 04, 2007, 06:53:38 PM »
I guess you did run the standard configuration procedure logging on to console or via ssh as "admin" and then configured as "gateway" ?

To check if it works log on to the gateway and ping some external address and then also on internel address. Then also ping from one internel client to the gateway and also to some address on the internett. Check also with the web browser on one LAN client.

Configuration can be shecked using this command from console: ifconfig

« Last Edit: December 04, 2007, 06:58:30 PM by arne »
......

Offline sognenovski

  • **
  • 64
  • +0/-0
Re: usb nic
« Reply #10 on: March 25, 2008, 02:54:51 AM »
Spend two days on this [sigh] a slightly different approach from nenonano with the same result :-P
Working fine on two test boxes as far I can see from the logs, but do let me know if this is not the SME friendly way.

Tested on
HP E-pc 42
HP E-Vectra (a little gem, power bill for 90 days $8.50AUD, measured)

 
Howto
SME Server 7.3 USB gateway nic setup for pppoe.
With this howto the USB nic will be use as the external interface.

Config the server as per normal for dialup use.
Choose"Private server and gateway" and select "Server and gateway dialup".
Enter username, password, com port, etc and dial up number (any number, must be at lease 10 digits)

After the reboot login to the console run this command and then plugin the USB nic.
# tail -f /var/log/messages

You should see output similar to this. In my case its using rtl8150 driver.

kernel: usb 5-2: new full speed USB device using address 3
kernel: drivers/usb/net/rtl8150.c: eth%d: rtl8150 is detected
kernel: divert: allocating divert_blk for eth1

If not check Bios setting and or use a different chipset USB nic.

Update SME database configuration with the new driver.
# /sbin/e-smith/db configuration settype EthernetDriver2 rtl8150

Also, update these.
# /sbin/e-smith/db configuration settype AccessType dedicated
# /sbin/e-smith/db configuration setprop ExternalInterface Configuration static
# /sbin/e-smith/db configuration setprop pppoe DemandIdleTime no
# /sbin/e-smith/db configuration setprop pppoe SynchronousPPP no
# /sbin/e-smith/db configuration setprop pppoe status enabled


To check your work.
# /sbin/e-smith/db configuration show |more

Create a file and save it to load the driver on startup.
# pico /etc/e-smith/events/actions/module-load

#--------------------------------/snip/---------------------------------

#!/bin/sh

# Edit/add module driver here
DRIVER1=rtl8150

# Custom initialisation for modules
echo Loading additional modules...
/sbin/modprobe $DRIVER1

#--------------------------------/snip/---------------------------------

Set permissions and add symbolic link.
# chmod 554 /etc/e-smith/events/actions/module-load
# ln -s /etc/e-smith/events/actions/module-load /etc/e-smith/events/local/S20module-load

Optional (a moment to yourself)
# sleep 10

Cross fingers and activate changes with signal event.
# signal-event post-upgrade; signal-event reboot

After the reboot, SME will start pppoe and populate IP fields and expand relevant templates.

Note: reconfiguring the server from the admin screen will drop your new db settings. You need to run the db commands again and signal event.

Thx
Steve