Suite à un topic sur le forum, j'ai réussi à creer une passerelle ethernet -> wifi entre 2 ordinateur sous archlinux avec ses scripts
script coté serveur
script coté client#!/bin/bash
/etc/rc.d/wicd stop
killall dhcpcd
dhcpcd eth0
ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc channel 1 essid xyoos key off
ifconfig wlan0 10.42.43.1 up
sudo echo "nameserver 208.67.222.222" > /etc/resolv.conf
rc.conf#!/bin/bash
/etc/rc.d/wicd stop
ifconfig wlan0 down
iwconfig wlan0 mode ad-hoc channel 1 essid xyoos key off
ifconfig wlan0 10.42.43.2 up
route add default gw 10.42.43.1 wlan0
sudo echo "nameserver 208.67.222.222" > /etc/resolv.conf
Entre deux machines archlinux ceci marche mais quand windows ou ubuntu essaye de se connecter, ceci ne marche pas je veux configurer le serveur dhcpcd:#
# /etc/rc.conf - Main Configuration for Arch Linux
#
# -----------------------------------------------------------------------
# LOCALIZATION
# -----------------------------------------------------------------------
#
# LOCALE: available languages can be listed with the 'locale -a' command
# HARDWARECLOCK: set to "UTC" or "localtime", any other value will result
# in the hardware clock being left untouched (useful for virtualization)
# TIMEZONE: timezones are found in /usr/share/zoneinfo
# KEYMAP: keymaps are found in /usr/share/kbd/keymaps
# CONSOLEFONT: found in /usr/share/kbd/consolefonts (only needed for non-US)
# CONSOLEMAP: found in /usr/share/kbd/consoletrans
# USECOLOR: use ANSI color sequences in startup messages
#
LOCALE="fr_FR.utf-8"
HARDWARECLOCK="localtime"
TIMEZONE="Europe/Paris"
KEYMAP="fr-latin9"
CONSOLEFONT="lat9w-16"
CONSOLEMAP=
USECOLOR="yes"
# -----------------------------------------------------------------------
# HARDWARE
# -----------------------------------------------------------------------
#
# MOD_AUTOLOAD: Allow autoloading of modules at boot and when needed
# MOD_BLACKLIST: Prevent udev from loading these modules
# MODULES: Modules to load at boot-up. Prefix with a ! to blacklist.
#
# NOTE: Use of 'MOD_BLACKLIST' is deprecated. Please use ! in the MODULES array.
#
MOD_AUTOLOAD="yes"
#MOD_BLACKLIST=() #deprecated
MODULES=(ath_pci)
# 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="xyoos_netbook"
# 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 192.168.0.2 netmask 255.255.255.0 broadcast 192.168.0.255"
eth0="dhcp"
wlan0="dhcp"
INTERFACES=(lo eth0)
WIRELESS_INTERFACE="wlan0"
# 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 10.42.43.1"
ROUTES=(!gateway)
# Setting this to "yes" will skip network shutdown.
# This is required if your root device is on NFS.
NETWORK_PERSIST="no"
# Enable these network profiles at boot-up. These are only useful
# if you happen to need multiple network configurations (ie, laptop users)
# - set to 'menu' to present a menu during boot-up (dialog package required)
# - prefix an entry with a ! to disable it
#
# Network profiles are found in /etc/network.d
#
# This now requires the netcfg package
#
#NETWORKS=(main)
# -----------------------------------------------------------------------
# DAEMONS
# -----------------------------------------------------------------------
#
# Daemons to start at boot-up (in this order)
# - prefix a daemon with a ! to disable it
# - prefix a daemon with a @ to start it up in the background
#
DAEMONS=(syslog-ng dbus @wicd @alsa @sshd @httpd @mysqld)
/etc/dhcpcd.conf
mais quand je restart le network: sudo /etc/rc.d/network restart# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.
# Inform the DHCP server of our hostname for DDNS.
hostname
# To share the DHCP lease across OSX and Windows a ClientID is needed.
# Enabling this may get a different lease than the kernel DHCP client.
# Some upstream DHCP servers may also require a ClientID, such as FRITZ!Box.
#clientid
# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Most distributions have NTP support.
option ntp_servers
# Respect the network MTU.
option interface_mtu
# A ServerID is required by RFC2131.
require dhcp_server_identifier
#pour que le dhcpcd ne touche pas au DNS
nohook resolv.conf
# A hook script is provided to lookup the hostname if not set by the DHCP
# server, but it should not be run by default.
#nohook lookup-hostname
#noipv4ll
#Ddns-update-style ad-hoc;
Subnet 10.42.43.0 netmask 255.0.0.0{
range 10.42.43.2 10.42.43.60;
default-lease-time 86400;
max-lease-time 604800;
option subnet-mask 255.0.0.0;
option domain-name-servers 208.67.222.222;
}
ceci donne:
mon but sera de pouvoir être tout le temps sous archlinux au lieu d'ubuntu et de partager ma connexion pour quelqu'un qui est sous windows ou ubuntu.:: Stopping Network [DONE]
:: Starting Network [BUSY] up: error fetching interface information: Device not found
wlan0 Link encap:Ethernet HWaddr 1C:4B:D6:69:D9:69
inet addr:10.42.43.2 Bcast:10.255.255.255 Mask:255.0.0.0
inet6 addr: fe80::1e4b:d6ff:fe69:d969/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5645 errors:0 dropped:0 overruns:0 frame:0
TX packets:3173 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:3130976 (2.9 Mb) TX bytes:444830 (434.4 Kb)
Error for wireless request "Set Mode" (8B06) :
SET failed on device wlan0 ; Device or resource busy.
dhcpcd: unknown option -- Subnet
dhcpcd: unknown option -- range
dhcpcd: unknown option -- default-lease-time
dhcpcd: unknown option -- max-lease-time
dhcpcd[2698]: unknown option `subnet-mask 255.0.0.0;'
dhcpcd[2698]: unknown option `domain-name-servers 208.67.222.222;'
dhcpcd: unknown option -- }
[FAIL]