[RESOLVED] Second NIC

Plugging in devices such as LAN adapters, Wi-Fi cards, printers, etc. to Arch Linux ARM.

[RESOLVED] Second NIC

Postby pepedog » Mon Aug 02, 2010 11:52 am

I got a usb nic, one you can by in the Apple store, or possibly cheaper on line.
It's white, small and neat, but does get a little warm, won't be putting it in natural position on top of dockstar.
I bears the Apple code MB442Z/A

To get it to work-
modprobe asix
ifconfig -a to see it
ifconfig eth1 xx.xx.xx.xx netmask xx.xx.xx.xx broadcast xx.xx.xx.xx
and would go in /etc/rc.conf as
MODULES=(asix)

INTERFACES=(eth0 eth1)

eth1="eth1 xx.xx.xx.xx netmask xx.xx.xx.xx broadcast xx.xx.xx.xx"
or
eth1="dhcp"
and possibly edit
gateway="default gw xx.xx.xx.xx"

Dave
Last edited by pepedog on Tue Aug 03, 2010 6:43 am, edited 1 time in total.
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Second NIC

Postby Fallinstar » Mon Aug 02, 2010 11:15 pm

Wow, that was relatively easy!
Fallinstar
 
Posts: 4
Joined: Fri Jul 30, 2010 10:56 pm

Re: Second NIC

Postby pepedog » Tue Aug 03, 2010 5:09 pm

I believe from a post I glimpsed that it is best to put external connection on eth1.
To get the box to be a dns and dhcpd server, just install dnsmasq
Once you know you connect both ways into the box, to get it sharing the internet, it's just this
eth0 lan, eth1 internet
$this->bbcode_second_pass_code('', 'echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
iptables -A FORWARD -i eth1 -o eth0 -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -i eth0 -o eth1 -j ACCEPT')

The first line of this appears to have been missing from the firewall builder I was using (shorewall)
This is the essence of my dnsmasq.conf file
$this->bbcode_second_pass_code('', 'dhcp-authoritative
dhcp-option=40,mollie
dhcp-option=42,0.0.0.0
dhcp-option=vendor:MSFT,2,1i
dhcp-range=192.168.3.50,192.168.3.150,255.255.255.0,12h
domain=mollie.dogagent.com
enable-tftp
interface=eth0
resolv-file=/etc/resolv.conf.tail
server=/3.168.192.in-addr.arpa/192.168.3.1
tftp-root=/var/ftpd')
Apparently, entries in the hosts file gets served if a dns query is sent

Dave
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Second NIC

Postby phdeez » Thu Sep 23, 2010 3:36 am

Kind of a weird question, but do you have an idea of how to pass all traffic through it? Basically making the two ports (eth0 & eth1) act like a switch?

Does that even make sense?
phdeez
 
Posts: 25
Joined: Wed Apr 07, 2010 3:05 am

Re: Second NIC

Postby pepedog » Thu Sep 23, 2010 6:46 am

Do you mean like a bridge, where everything coming in via etho goes straight to eth1?

Dave
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Second NIC

Postby phdeez » Thu Sep 23, 2010 10:41 pm

Well, not exactly since I'd still like ip functionality on the dockstar. I guess you could say I'd like to have both interfaces in the same broadcast domain so a device connected on eth1 could get an ip from a DHCP server connected to the *other* end of eth0.

(router) ----- [eth0] |dockstar:obtain ip from (router)| [eth1] ----- |PC:obtain ip from (router)|
phdeez
 
Posts: 25
Joined: Wed Apr 07, 2010 3:05 am

resolved

Postby jeajea » Mon May 23, 2011 9:50 pm

Do you know if the asix module supports the ASIX AX88178 (I am running the latest version of plug box on this Dockstar)? It is a gigabit USB NIC. After I did the following to rc.conf it doesn’t start automatically at boot.
$this->bbcode_second_pass_code('', '
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=(asix)

# Scan for LVM volume groups at startup, required if you use LVM
USELVM="no"

# -----------------------------------------------------------------------
# NETWORKING
# -----------------------------------------------------------------------
#
# HOSTNAME: Hostname of machine. Should also be put in /etc/hosts
#
HOSTNAME="DS101"

# Use 'ifconfig -a' or 'ls /sys/class/net/' to see all available interfaces.
#
# Interfaces to start at boot-up (in this order)
# Declare each interface then list in INTERFACES
# - prefix an entry in INTERFACES with a ! to disable it
# - no hyphens in your interface names - Bash doesn't like it
#
# DHCP: Set your interface to "dhcp" (eth0="dhcp")
# Wireless: See network profiles below
#

#Static IP example
eth0="eth0 172.24.80.178 netmask 255.255.255.224 broadcast 172.24.80.191"
eth1="eth1 192.168.1.213 netmask 255.255.255.0 broadcast 192.168.1.255"
#eth0="dhcp"
INTERFACES=(eth0,eth1)

# Routes to start at boot-up (in this order)
# Declare each route then list in ROUTES
# - prefix an entry in ROUTES with a ! to disable it
#
gateway="default gw 172.24.80.161"
ROUTES=(gateway)

')

$this->bbcode_second_pass_code('', '
[root@DS101 ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 02:50:43:A4:90:42
inet addr:172.24.80.178 Bcast:172.24.80.191 Mask:255.255.255.224
inet6 addr: fe80::50:43ff:fea4:9042/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:140 errors:0 dropped:0 overruns:0 frame:0
TX packets:123 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13648 (13.3 Kb) TX bytes:13691 (13.3 Kb)
Interrupt:11

eth1 Link encap:Ethernet HWaddr 00:0E:C6:88:7E:A5
BROADCAST 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: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
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 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)


')

When I start it manually with
$this->bbcode_second_pass_code('', '
[root@DS101 ~]# ifconfig eth1 192.168.1.213 netmask 255.255.255.0 broadcast 192.168.1.255

')

It appears to be up but I can't ping in either direction.
$this->bbcode_second_pass_code('', '
[root@DS101 ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 02:50:43:A4:90:42
inet addr:172.24.80.178 Bcast:172.24.80.191 Mask:255.255.255.224
inet6 addr: fe80::50:43ff:fea4:9042/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:359 errors:0 dropped:0 overruns:0 frame:0
TX packets:230 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:34686 (33.8 Kb) TX bytes:26375 (25.7 Kb)
Interrupt:11

eth1 Link encap:Ethernet HWaddr 00:0E:C6:88:7E:A5
inet addr:192.168.1.213 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fe80::20e:c6ff:fe88:7ea5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:36 errors:0 dropped:0 overruns:0 frame:0
TX packets:34 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3056 (2.9 Kb) TX bytes:4141 (4.0 Kb)

lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:16436 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)

')

What does the lsusb for your 100 megabit NIC show?
Last edited by jeajea on Wed May 25, 2011 3:40 pm, edited 1 time in total.
Jim Anderson
3 Dockstars, 3 Pogoplug V2 and a Zyxel NSA325
Treasure Island, Fl
jeajea
 
Posts: 121
Joined: Wed Aug 25, 2010 4:00 pm

Re: Second NIC

Postby pepedog » Mon May 23, 2011 10:48 pm

I just plugged in a Belking usb lan gigbit adapter. It appears to be same hardware as your enquiry, and it does work fine.
$this->bbcode_second_pass_code('', 'dmesg
[296354.494924] asix 1-1.4:1.0: eth2: register 'asix' at usb-orion-ehci.0-1.4, ASIX AX88178 USB 2.0 Ethernet, 00:22:75:d6:af:d3

lsusb
Bus 001 Device 006: ID 050d:5055 Belkin Components F5D5055 Gigabit Network Adapter [AX88xxx]
')
Also, being a little older and hopefully wiser from time of my original post, you don't have to put anything in MODULES of rc.conf

My GATEWAY is commented out, and have ROUTES=(!gateway)
Don't know why that is there, but it all works

You will need this, also done but installing iptables and in /etc/conf.d/iptables IPTABLES_FORWARD=1
echo 1 >/proc/sys/net/ipv4/ip_forward
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Second NIC

Postby jeajea » Mon May 23, 2011 11:53 pm

Thanks,
that fixed part of the problem. However,
Eth1 still doesn’t start automatically
When I enter ifconfig eth1 192.168... manually samba shares work on both subnets but ping still doesn’t work in either direction on eth1

Also, with no default gateway I don’t see how pacman could work.

I am a moderately experienced Linux/Solaris user but have limited sysadmin experience.

opps
samba shares aren't available on eth1
Jim Anderson
3 Dockstars, 3 Pogoplug V2 and a Zyxel NSA325
Treasure Island, Fl
jeajea
 
Posts: 121
Joined: Wed Aug 25, 2010 4:00 pm

Re: Second NIC

Postby pepedog » Tue May 24, 2011 12:29 am

When you say "start automatically", do you mean on boot?
What about when you
/etc/rc.d/network restart
I got one dockstar on a fixed public ip and other interface dhcp, with firewall allowing samba on public to access, and it works

Are you just making device available to 2 networks?
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Next

Return to Hardware

Who is online

Users browsing this forum: No registered users and 14 guests