LinuxQuestions.org
Help answer threads with 0 replies.
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 10-08-2014, 03:32 AM   #1
TeaYoung
LQ Newbie
 
Registered: Apr 2013
Posts: 26

Rep: Reputation: Disabled
How do I bridge the eth0 (ethernet) and eth1 (WiFi_Ap)?


Hello.

I am in the WiFi test embedded board.

The ethernet port eth0 is connected to the Internet.

The interface eth1 is caused due to the WiFi chip.

The Access Point can be used as a WiFi eth1 is.

We use the following instructions to Acess Point with WiFi on eth1 is.

# ifconfig eth1 192.168.10.1 up
# dnsmasq
# iwpriv eth1 AP_SET_CFG ASCII_CMD=AP_CFG,SSID="WiFi_Test",SEC="wpa2-psk",KEY=ac10b3e2e8b13e67841b01e2eb07bd95da516fdac049d486112997bf16afb24b,CHANNEL=11,PREAMBLE=0,MAX _ SCB=8,END
# iwpriv eth1 AP_BSS_START

also has access to a WiFi Access Point in Mobile when used with the eth1.

But this was a closed network eth1 and Mobile Bay.

What I want eth0 and eth1 are connected to each other must also be connected to the Acess Point Mobile is another place to use ping.

I can use the Ping to 192.168.1.1 eth0.

But I can not use Ping to 192.168.1.1 Mobile In.

I can not use the brctl command.

I must be the only bridge to eth0 and eth1 using only iptables command.


1. If I bridge the eth1 eth0 and the dnsmasq command should I run?
( I think you are thinking of eth0 dhcp also not necessary because the bridge.)

2.How should I use to bridge the eth0 and eth1 (WiFi Access Point) the iptables command?
(I did not work looked like using the command below.)

# echo 1 > /proc/sys/net/ipv4/ip_forward
# iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
# iptables -A FORWARD -i eth1 -o eth0 -j ACCEPT
# iptables -A FORWARD -i eth0 -o eth1 -m state --state ESTABLISHED,RELATED -j ACCEPT

3. If that bridge is normally eth0 and eth1 eth1 geotingayo also be automatically assigned an IP doeneunge fit?


Below is my ifconfig results.


root@test:~# ifconfig
eth0 Link encap:Ethernet HWaddr 00:00:00:00:00:00
inet addr:192.168.0.88 Bcast:192.168.255.255 Mask:255.255.0.0
UP 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)
Interrupt:170

eth1 Link encap:Ethernet HWaddr C4:23:7A:00:6E:93
UP 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
UP LOOPBACK RUNNING MTU:65536 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)

root@test:~#
 
Old 10-08-2014, 06:40 AM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: Fedora
Posts: 4,177

Rep: Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272Reputation: 1272
You don't need a bridge when you have a router.

The router you are setting up in step 2 looks correct except Nat is going the wrong way. You want to do it toward eth0.
 
Old 10-12-2014, 07:01 PM   #3
TeaYoung
LQ Newbie
 
Registered: Apr 2013
Posts: 26

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by smallpond View Post
You don't need a bridge when you have a router.

The router you are setting up in step 2 looks correct except Nat is going the wrong way. You want to do it toward eth0.
My route is as follows: The environment.

What should I do? I do not know.....

root@test:~# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.0.1 0.0.0.0 UG 0 0 0 eth0
192.168.0.0 * 255.255.0.0 U 0 0 0 eth0
192.168.10.0 * 255.255.255.0 U 0 0 0 eth1
root@test:~#
 
  


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
[SOLVED] How do you bridge the eth0 (ethernet) and eth1 (WiFi_Ap)? TeaYoung Linux - Software 1 10-25-2014 05:51 AM
can i bridge eth0:1 with eth1? stankeeper Linux - Networking 1 11-06-2005 01:53 PM
How To Rename Ethernet Card Eth1 to Eth0 chammoud Linux - Networking 4 04-20-2005 06:01 AM
Wireless network on eth1 diabled Ethernet eth0 and eth0 never comes back tadatoshi Linux - Wireless Networking 4 09-23-2004 05:57 PM
ethernet bridge (wlan0 eth1) - canīt ping magicien Linux - Wireless Networking 0 07-05-2004 03:59 AM

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

All times are GMT -5. The time now is 06:37 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