LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-12-2010, 05:14 PM   #1
sticky73
LQ Newbie
 
Registered: Sep 2010
Posts: 4

Rep: Reputation: 0
broadcast to router


hi
i connect to the internet using my phone (/etc/init.d/net.usb0)
i want to pipe this connection from my computer into a router and broadcast it

how would i go about doing this?
Code:
eth0      Link encap:Ethernet  HWaddr e0:cb:4e:44:f3:83 
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::e2cb:4eff:fe44:f383/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:1219 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1140 errors:0 dropped:0 overruns:0 carrier:23
          collisions:0 txqueuelen:1000
          RX bytes:818864 (799.6 KiB)  TX bytes:105753 (103.2 KiB)
          Interrupt:19

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:425 errors:0 dropped:0 overruns:0 frame:0
          TX packets:425 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:33368 (32.5 KiB)  TX bytes:33368 (32.5 KiB)

usb0      Link encap:Ethernet  HWaddr fa:f5:7a:37:17:9a 
          inet addr:172.20.23.XXX  Bcast:172.20.23.255  Mask:255.255.255.252
          inet6 addr: fe80::f8f5:7aff:fe37:179a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:3056 errors:30 dropped:0 overruns:0 frame:30
          TX packets:3988 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1983935 (1.8 MiB)  TX bytes:675978 (660.1 KiB)
i also have an ath9k wireless card
i'm using gentoo linux
 
Old 09-12-2010, 09:08 PM   #2
cjcox
Member
 
Registered: Jun 2004
Posts: 307

Rep: Reputation: 42
I think what you asking is that you want people to gateway through your phone? True? If you're phone is on the network, you should be able to reach the other hosts on the network (ideally). Can you clear things up for me a bit? Maybe a more specific example of what you are wanting to do?
 
Old 09-12-2010, 10:12 PM   #3
sticky73
LQ Newbie
 
Registered: Sep 2010
Posts: 4

Original Poster
Rep: Reputation: 0
this is what i'm aiming for:
computer b (wlan0) -> router (eth0) -> computer a (usb0) -> phone -> internet


computer a uses net.usb0 to connect to the internet through the phone
i want to pipe this connection to the router via eth0
the router then would broadcast the signal and computer b would connect to the router via wlan0

Last edited by sticky73; 09-12-2010 at 10:16 PM.
 
Old 09-13-2010, 01:04 PM   #4
sticky73
LQ Newbie
 
Registered: Sep 2010
Posts: 4

Original Poster
Rep: Reputation: 0
Here is everything I've tried:
/etc/conf.d/net:
Code:
config_usb0=( "dhcp" )
config_eth0=( "192.168.1.2/24" )
iptables:
Code:
iptables -F
iptables -t nat -F
iptables -P INPUT ACCEPT
iptables -P OUTPUT ACCEPT
iptables -P FORWARD DROP
export LAN=eth0
export WAN=usb0
iptables -I INPUT 1 -i ${LAN} -j ACCEPT
iptables -I INPUT 1 -i lo -j ACCEPT
iptables -A INPUT -p UDP --dport bootps ! -i ${LAN} -j REJECT
iptables -A INPUT -p UDP --dport domain ! -i ${LAN} -j REJECT
iptables -A INPUT -p TCP --dport ssh -i ${WAN} -j ACCEPT
iptables -A INPUT -p TCP ! -i ${LAN} -d 0/0 --dport 0:1023 -j DROP
iptables -A INPUT -p UDP ! -i ${LAN} -d 0/0 --dport 0:1023 -j DROP
iptables -I FORWARD -i ${LAN} -d 192.168.1.0/255.255.255.0 -j DROP
iptables -A FORWARD -i ${LAN} -s 192.168.1.0/255.255.255.0 -j ACCEPT
iptables -A FORWARD -i ${WAN} -d 192.168.1.0/255.255.255.0 -j ACCEPT
iptables -t nat -A POSTROUTING -o ${WAN} -j MASQUERADE 
/etc/init.d/iptables save
router (linksys wrt120n):
Code:
Internet Connection Type
[] DHCP
[x] Static IP
[] PPPoE
[] PPPTP
[] L2TP
[] Telstra Cable
Internet IP Address: 192.168.1.1
Subnet Mask: 255.255.255.0
Default Gateway: 192.168.1.2
DNS: 208.67.222.222
Local IP Address: 192.168.1.1
DHCP Server [x] enabled
Start Address: 192.168.1.100
Max 50 Users
Range: 192.168.1.100 - 149
Routing Table:
Dest IP              Subnet Mask        Gateway      Interface
0.0.0.0              0.0.0.0                 192.168.1.2  WAN(Internet)
208.67.222.222  255.255.255.255   192.168.1.2  WAN(Internet)
192.168.1.2       255.255.255.255   192.168.1.1  WAN(Internet)
192.168.1.0       255.255.255.0       192.168.1.1 LAN & Wireless
127.0.0.1          255.255.255.255   127.0.0.1      Loopback
starting services:
Code:
/etc/init.d/iptables start
/etc/init.d/net.usb0 start
/etc/init.d/net.eth0 start
still, computer B can't access the internet and the "web" light on the router is not lit
this leads me to believe i'm not using iptables correctly (or incorrect router settings)
i'm pretty sure the router is capable of this, since i've used it as a network switch in the past (internet -> router a -> router b -> LAN)

ifconfig:
Code:
eth0      Link encap:Ethernet  HWaddr e0:cb:4e:44:f3:83  
          inet addr:192.168.1.2  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::e2cb:4eff:fe44:f383/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:385 errors:0 dropped:0 overruns:0 frame:0
          TX packets:369 errors:0 dropped:0 overruns:0 carrier:13
          collisions:0 txqueuelen:1000 
          RX bytes:227749 (222.4 KiB)  TX bytes:34588 (33.7 KiB)
          Interrupt:19 

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:72 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4500 (4.3 KiB)  TX bytes:4500 (4.3 KiB)

usb0      Link encap:Ethernet  HWaddr fa:f5:7a:37:17:9a  
          inet addr:172.20.23.xxx  Bcast:172.20.23.255  Mask:255.255.255.252
          inet6 addr: fe80::f8f5:7aff:fe37:179a/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2591 errors:13 dropped:0 overruns:0 frame:13
          TX packets:3315 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:1740041 (1.6 MiB)  TX bytes:575461 (561.9 KiB)
emerge --info:
Code:
Portage 2.1.8.3 (default/linux/x86/10.0/desktop, gcc-4.4.3, glibc-2.11.2-r0, 2.6.34-gentoo-r1 i686)
=================================================================
System uname: Linux-2.6.34-gentoo-r1-i686-Intel-R-_Atom-TM-_CPU_N270_@_1.60GHz-with-gentoo-1.12.13
Timestamp of tree: Sun, 12 Sep 2010 15:30:01 +0000
app-shells/bash:     4.1_p7
dev-java/java-config: 2.1.11
dev-lang/python:     2.6.5-r3, 3.1.2-r4
dev-util/cmake:      2.8.1-r2
sys-apps/baselayout: 1.12.13
sys-apps/sandbox:    1.6-r2
sys-devel/autoconf:  2.13, 2.65
sys-devel/automake:  1.4_p6-r1, 1.8.5-r4, 1.9.6-r3, 1.10.3, 1.11.1
sys-devel/binutils:  2.20.1-r1
sys-devel/gcc:       4.4.3-r2
sys-devel/gcc-config: 1.4.1
sys-devel/libtool:   2.2.6b
sys-devel/make:      3.81-r2
virtual/os-headers:  2.6.30-r1
ACCEPT_KEYWORDS="x86"
ACCEPT_LICENSE="* -@EULA"
CBUILD="i686-pc-linux-gnu"
CFLAGS="-O2 -march=core2 -mtune=generic -fomit-frame-pointer -pipe"
CHOST="i686-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/X11/xkb /var/lib/hsqldb"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=core2 -mtune=generic -fomit-frame-pointer -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests distlocks fixpackages news parallel-fetch protect-owned sandbox sfperms strict unmerge-logs unmerge-orphans userfetch"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--warn-once"
MAKEOPTS="-j2"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X a52 aac acl acpi alsa berkdb bittorrent bluetooth branding bzip2 cairo cdr cli consolekit cracklib crypt cups cxx dbus dri dts dvd dvdr emboss encode exif extras fam firefox flac fortran gdbm gif gnutls gpm hal iconv ipv6 java jpeg lcms ldap libnotify mad mikmod mng modules mp3 mp4 mpeg mudflap ncurses nls nptl nptlonly nsplugin ogg opengl openmp pam pango pcre pdf perl png ppds pppd python readline reflection sdl session spell ssl startup-notification svg sysfs tcpd thunar tiff truetype unicode usb vorbis x264 x86 xcb xml xorg xulrunner xv xvid zlib" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1 emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="evdev synaptics" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" RUBY_TARGETS="ruby18" USERLAND="GNU" VIDEO_CARDS="intel" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account" 
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LANG, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
 
Old 09-14-2010, 12:00 PM   #5
sticky73
LQ Newbie
 
Registered: Sep 2010
Posts: 4

Original Poster
Rep: Reputation: 0
 
  


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
How 2 get Debian to broadcast its host name to my router? lindylex Linux - Networking 11 12-04-2009 09:18 PM
Broadcast without broadcast Mammuth Linux - Networking 1 10-01-2006 04:58 PM
SuSE 9.2 wireless connection loss when SSID broadcast disabled on router cheapuser SUSE / openSUSE 0 01-30-2005 12:03 AM
udp broadcast from one subnet to another thru a linux router siva_bhavani Linux - Networking 1 12-30-2004 10:20 AM
Enabling subnet directed broadcast on Linux Router yrraja Linux - Networking 3 07-01-2004 12:27 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 09:53 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
Open Source Consulting | Domain Registration