Welcome, Guest. Please login or register.
April 21, 2014, 01:33:57 AM
Home Help Search Calendar Login Register
Show unread posts since last visit.
News: Let Pardus-Anka become #1: Pardus-Anka Bug ReportPardus-Anka World Google+ | The Pardus wiki  | Visit Pardus-Anka official website  | Register as forum member?  Email the moderator!

+  Pardus Worldforum
|-+  Assistance
| |-+  Laptop
| | |-+  How to share eth0 > wlan0 Internet? Ad-Hoc.
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Print
Author Topic: How to share eth0 > wlan0 Internet? Ad-Hoc.  (Read 2606 times)
Alexey
Pardus fellow craft
**
Gender: Male
Posts: 95



View Profile
« on: May 17, 2011, 17:31:09 PM »

Previously, I was able to set up wi-fi card (iwconfig), dhcp server and iptables.

echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE

How do correctly configure wi-fi card and a dhcp server?

Code:
krab@note ~ $ ifconfig eth0
eth0      Link encap:Ethernet  HWaddr 00:26:2D:AC:B9:E2 
          inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0

Logged
Alexey
Pardus fellow craft
**
Gender: Male
Posts: 95



View Profile
« Reply #1 on: May 20, 2011, 01:37:09 AM »

Okey!
Code:
$ nano /etc/default/dhcp
INTERFACES="eth0"
$ nano /etc/default/dhcpd
INTERFACES="eth0"

Code:
$ nano /etc/dhcp/dhcpd.conf
default-lease-time 600;
max-lease-time 7200;
option subnet-mask 255.255.255.0;
option broadcast-address 192.168.2.255;
option routers 192.168.2.1;
option domain-name-servers 192.168.1.1;

subnet 192.168.2.0 netmask 255.255.255.0 {
interface wlan0;
range 192.168.2.2 192.168.2.20;
}


Code:
iwconfig wlan0 mode ad-hoc
iwconfig wlan0 channel 1
iwconfig wlan0 Bit 54Mb/s
iwconfig wlan0 essid "linux"
ifconfig wlan0 192.168.2.1 netmask 255.255.255.0 up

Code:
sudo service dhcpd restart

What do I get?

Internet from my ADSL router (configured as DHCP) > notebook (eth0) > wi-fi AD-HOC (wlan0) > Galaxy TAB!
« Last Edit: May 23, 2011, 00:53:58 AM by Alexey » Logged
Pages: [1] Go Up Print 
« previous next »
Jump to:  


Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!